circular_buffer
circular_buffer copied to clipboard
feat: Add emplace_back() and emplace_front() to boost::circular_buffer
this should be trivial to do. In fact, I might give implementing it a shot...
It's already implemented in some PR
https://github.com/boostorg/circular_buffer/pull/15
thx! This is exactly what I was looking for... Yesterday, I have written the feature myself and after reviewing the PR commits, I find it recomforting that I have came up more or less with exactly the same implementation... (minus the unit tests)...
I suppose this is can be seen as a confirmation that the pull request is good...
Any idea when it is going to be merged? Any chance that it makes it to the next release?
Note, that it does not change anything for me as taking the PR code and using it simply consists of copying a header file. No recompilation is required... but I am thinking about the other users...
That was the lack of emplace functions that made me stick with std::deque and use it as a circular buffer...
but boost::circular_buffer is incredibly superior for that purpose due to its amazing memory allocation behavior. deque keeps allocating/deallocating all the way even if its number of elements remains constant...
boost::circular_buffer is an amazing little known gem...
looks like nobody care about this PR. I just use code from PR directly since boost containers is header-only.