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<int> cb(10); Expected parameter decelerator Expected ')' 2 - Second question is when I add element into boost::circular_buffer using push_back, how to extract / get the element from circular_buffer, pop_front does not give the element. 回答1: boost::circular_buffer<T>::front() gives you a reference to the element