Questions tagged [boost-circularbuffer]

8 questions
2
votes
2 answers

Using scoped `polymorphic_allocator` with `boost::circular_buffer` fails

Background I want to use boost::circular_buffer with a scoped C++17 std::pmr::polymorphic_allocator. I.e. I want the same allocator for an outer container to be used for inner containers. Side note: boost::circular_buffer is allocator-aware and the…
mandrake
  • 1,213
  • 1
  • 14
  • 28
2
votes
1 answer

How to get element from circular_buffer

I am using boost library in MAC (xcode). I have two questions about boost::circular_buffer. 1 - I am getting syntax error when declaring the circular_buffer boost::circular_buffer cb(10); Expected parameter decelerator Expected ')' 2 - Second…
Ibrar Ahmed
  • 1,039
  • 1
  • 13
  • 25
1
vote
1 answer

Using a circular buffer on disk

I was trying to create a memory-mapped circular buffer on disk using Boost, and I read this answer: https://stackoverflow.com/a/29265629/8474732 However, I have a hard time reading the circular buffer that was written. I tried to do a push_back on…
1
vote
1 answer

boost::lockfree::spsc_queue and boost::asio

I'm would like to receive directly into a boost::lockfree:spsc_queue (or, alternatively, a boost::circular_buffer) from a boost::asio::async_read call. Looks like I need to write a wrapper to make the spsc_queue a MutableBuffer. Can anyone share…
schuess
  • 1,009
  • 1
  • 10
  • 21
1
vote
1 answer

How can I use boost::regex on a boost::circular buffer?

I'm capturing data in a boost::circular_buffer and would like to now perform a regex search on the contents but I'm having some difficulty getting boost::regex to understand how to look at the buffer. Here's a stripped down version of the sort of…
Jon Cage
  • 36,366
  • 38
  • 137
  • 215
0
votes
0 answers

How to access all the elements at once in boost circular buffer?

I declared a buffer of vector in c++: boost::circular_buffer> poses {20}; I need to store the values of the buffer into a tensor of shape [1, 20, 30]. Each vector in the buffer is of size 30. So the circular buffer has 20 size…
0
votes
2 answers

Is there a way to keep the front of an empty boost circular buffer hot in cache?

There is a specific circular buffer I wish to keep hot in cache, however it can go unused for extended periods of time. This is causing cache misses. I have an idle loop that can take responsibility for keeping the location hot, but I cannot see a…
Chuu
  • 4,301
  • 2
  • 28
  • 54
0
votes
0 answers

How to declare a boost::circular_buffer to be initialized later?

I'm trying to use a circular buffer on disk, but to simplify my question I'm trying to use a circular buffer in different functions without having to pass the circular buffer as an argument. So it may look like this: #include…