Default size for vector and list

C

campos

Hi all,

I want to know the default capacity when creating STL vector and list.
Any doc or manual I can refer to? Thanks in advance!
 
N

Neelesh Bodas

Hi all,

I want to know the default capacity when creating STL vector and list.
Any doc or manual I can refer to? Thanks in advance!

The C++ standard doesnot specify any such "default" capacity for
container classes.

-N
 
M

Michael DOUBEZ

campos a écrit :
Hi all,

I want to know the default capacity when creating STL vector and list.
Any doc or manual I can refer to? Thanks in advance!

There is no such default in C++.

List have a maximum size returned by the list<>::max_size() member function.

For vector:
* vector<>::capacity() returns the current capacity of the vector
(size it can hold before reallocating upon insertion)
* vector<>::max_capacity() returns the maximum capacity the vector
can reach.

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,197
Messages
2,571,040
Members
47,642
Latest member
arunkumar99

Latest Threads

Top