circular_buffer icon indicating copy to clipboard operation
circular_buffer copied to clipboard

feat: Add emplace_back() and emplace_front() to boost::circular_buffer

Open lano1106 opened this issue 1 year ago • 4 comments

this should be trivial to do. In fact, I might give implementing it a shot...

lano1106 avatar May 31 '23 04:05 lano1106

It's already implemented in some PR

Lishen1 avatar May 31 '23 23:05 Lishen1

https://github.com/boostorg/circular_buffer/pull/15

Lishen1 avatar Jun 01 '23 07:06 Lishen1

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...

lano1106 avatar Jun 01 '23 14:06 lano1106

looks like nobody care about this PR. I just use code from PR directly since boost containers is header-only.

Lishen1 avatar Jun 01 '23 14:06 Lishen1