Opened 5 years ago

Last modified 10 months ago

#9299 new Feature Requests

Feature Requests: circular_buffer::emplace(...)

Reported by: anonymous Owned by: No-Maintainer
Milestone: To Be Determined Component: circular_buffer
Version: Boost Development Trunk Severity: Not Applicable
Keywords: circular_buffer emplace c++11 Cc:


I think a great addition to circular_buffer would be to support emplace(...)/emplace_back()/emplace_front() to make it more C++11 compliant.

At the first quick glance I took at the source, implementation seems straight-forward, more or less c&p the code from insert/push_back/push_front and construct the items in-place instead. The tricky part however would be to stay compliant with older C++ versions, if that is a desired feature (and it seems to be considering that e.g. Boost.Move can be used instead of the C++11 move semantics). I do not have an idea how to do this as I'm not an experienced boost developer (or actually even user for that matter).

If older C++-compliance is not needed and my assumption of simply "c&ping insert/push_back/push_front" is confirmed by a boost developer, I could probably provide a patch a few weeks from now (my time is a bit limited at the moment) if required. If the compliance is needed however, I would prefer that a more experienced developer would implement it.

Attachments (2)

Change History (6)

comment:1 Changed 5 years ago by Jan Gaspar

Owner: changed from Jan Gaspar to No-Maintainer

comment:2 Changed 11 months ago by Doug Brunner <doug.a.brunner@…>

+1 to this, would be a welcome refinement.

comment:3 Changed 11 months ago by ai0867@…

I've attached two patches implementing emplace_front() and emplace_back() for circular_buffer and circular_buffer_space_optimized.

comment:4 Changed 10 months ago by ai0867@…

Also submitted as a pull request at

Note: See TracTickets for help on using tickets.