
On Wed, Apr 23, 2008 at 1:22 PM, Stjepan Rajko <stipe@asu.edu> wrote:
Hello,
I've been finding the circular_buffer library very helpful (thanks for a great lib!), but recently found the following behavior surprising (this is using a recent svn trunk, if it matters):
boost::circular_buffer<int> one(3); boost::circular_buffer<int> two(one);
std::cout<<one.capacity()<<std::endl; // outputs 3 std::cout<<two.capacity()<<std::endl; // outputs 0, I was expecting 3
Why does the copy constructor not copy the capacity? It seems like capacity is an essential property of circular_buffer, and as such I'd expect it to be copied as a part of copy construction.
After looking at the code, it looks like this is a bug. I submitted a ticket with a guess at a patch: http://svn.boost.org/trac/boost/ticket/1852 Stjepan