std::tr1::array - What's the difference between max_size and size?
Thank you.
-Sarath
Good question. It's not explained in the draft
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf
But max_size probably returns the maximum number of elements that can
be stored in this container. Since array is a fixed-size container I
would guess that the resulf of array<T,N>::max_size() equals
array<T,N>::size().
Cheers!
SG
STL containers in general provide both member functions. size() tells
you how many elements there are currently in the container, and
max_size() gives you an estimate of the maximum number of elements that
you could put into the container.
For array, both values are the same.
--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of
"The Standard C++ Library Extensions: a Tutorial and Reference"
(www.petebecker.com/tr1book)
Thanks Pete and SG