Re: [boost] boost::array support for runtime-sized arrays

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Steven Burns Sent: Wednesday, July 19, 2006 12:56 PM To: boost@lists.boost.org Subject: [boost] boost::array support for runtime-sized arrays
I realize you could simply use std::vector, but sometimes all you want is a fixed-size array (but sized at runtime). Besides, I am not sure about the overhead involved with std::vector for these simple scenarios.
I doubt it would be much more if at all slower to use vector so long as you only allocate once.

I think you could create an allocator that took this 'runtime size' as a constructor parameter, and return that value for the allocator's .max_size() member function. -----Original Message----- From: Sohail Somani [mailto:s.somani@fincad.com] Sent: Wednesday, July 19, 2006 12:59 PM To: boost@lists.boost.org Subject: Re: [boost] boost::array support for runtime-sized arrays
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Steven Burns Sent: Wednesday, July 19, 2006 12:56 PM To: boost@lists.boost.org Subject: [boost] boost::array support for runtime-sized arrays
I realize you could simply use std::vector, but sometimes all you want is a fixed-size array (but sized at runtime). Besides, I am not sure about the overhead involved with std::vector for these simple scenarios.
I doubt it would be much more if at all slower to use vector so long as you only allocate once. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Michael Nicolella
-
Sohail Somani