Simple question about vectors
My reference says that functions like at() and resize() takes a parameter of type size_type. How do I know what size_type is for my compiler and will it be different if I use other compilers?
quote:Original post by xg0blin
size_t is defined in stdlib.h I believe, so just look in the file.
He is reffering to size_type which is defined in the std::vector container.
Fold, to answer your question, size_type is defined as a type that can hold any value smaller than the maximum size that a vector container can be for the specific type of objects that it is to hold. Did that make sense? Perhaps someone can explain this better...
[edited by - chacha on October 22, 2003 10:54:39 AM]
quote:Original post by __fold
chacha: Seems resonable. Is it always signed?
No, an unsigned integral type.
[ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || CUJ || MSVC++ Library Fixes || BarrysWorld || E-Mail Me ]
quote:Original post by xg0blin
size_t is defined in stdlib.h I believe, so just look in the file.
He means size_type in the vector type as was stated. However, size_t is defined in cstddef in the std namespace.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement