|
-
February 4th, 2014, 09:43 AM
#2
Re: STL stack queue
 Originally Posted by Jose M
how can I use the function members of the container vector in the next code?
The second parameter of a stack definition allows you to define which container the stack is supposed to use internally. The default is a deque and you can change it to for example a vector as you suggest.
But this doesn't influence the stack interface, it will remain the same. A stack is a stack. But the properties of the stack will reflect that of the internal container. For example a deque and a vector handles memory differently when they grow/shrink and the stack will adopt the respective behaviour.
I recommend The C++ Standard Library, second edition, by Josuttis as a very good reference for topics like this.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|