Reputation: 2907
What is the maximum capacity of an STL queue, considering that it holds ints. By maximum capacity I mean the max number of integers it can hold at maximum capacity.
thanks
Upvotes: 1
Views: 7116
Reputation: 131799
C++ Reference holds an answer for that.
In the end, it relies on the underlying container of std::queue
. Its max_size
is also the max_size
of the queue.
Upvotes: 3
Reputation: 941545
There's a big difference between theoretical maximum as returned by queue::max_size() and actual maximum. You probably only ever really care about the latter, but there's no way to find out until it is too late. It heavily depends on the state of the heap and the virtual memory address space.
Upvotes: 4