Re: [boost] [circular_buffer] why is there no reserve(size_type)?

Sorry I don't have time to do this. Anyway IMO implementing reserve would give an impression that the capacity is not fixed and increases as you put elements into the circular buffer. And at last circular buffer is not a vector. ----- Original Message ---- From: Thorsten Ottosen <thorsten.ottosen@dezide.com> To: boost@lists.boost.org Sent: Wednesday, 11 June, 2008 9:49:29 PM Subject: Re: [boost] [circular_buffer] why is there no reserve(size_type)? Jan Gaspar skrev:
because: 1) it's behaviour is slightly different from the standard - you can increase but also decrease the capaciry of the container; decreasing of the capacity is not supported by reserve() 2) the word capacity is used all over the documentation of the circular buffer. I think set_capacity expresses better what the method does.
So the function is slightly different from the one in std::vector :-) Having a reserve() won't hurt ... in fact, it will make it easier to write code that works for both vector and circular_buffer. -Thorsten _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost __________________________________________________________ Sent from Yahoo! Mail. A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html

Jan Gaspar skrev:
Sorry I don't have time to do this. Anyway IMO implementing reserve would give an impression that the capacity is not fixed
but how can it be fixed if set_capacity can alter it?
and increases as you put elements into the circular buffer. And at last circular buffer is not a vector.
no, but there are overlaps in functionality/use-cases and not having reserve makes it harder to write generic code that accepts either type. -Thorsten
participants (2)
-
Jan Gaspar
-
Thorsten Ottosen