I am using boost library in MAC
(xcode
). I have two questions about boost::circular_buffer
.
1 - I am getting syntax error when dec
boost::circular_buffer
gives you a reference to the element at the "front", while boost::circular_buffer
will remove that element.
boost::circular_buffer
gives you a reference to the element at the back, while boost::circular_buffer
removes that element.
It appears your syntax error is resulting from the most vexing parse. Try instead:
boost::circular_buffer cb;
cb.set_capacity(10);
Or more succinctly:
boost::circular_buffer cb((10));