Aug 26, 2018
Learning C++ | Basics
C++ | Stack
A container adaptor keeps internally a container object as data, which is initialized by this constructor:
initialization constructor
Constructs a container adaptor whose internal container is initialized to a copy of ctnr.
move-initialization constructor
Constructs a container adaptor whose internal container acquires the value of ctnr by move-constructing it.
allocator constructor
Constructs a container adaptor whose internal container is constructed with alloc as argument.
initialization with allocator constructor
Constructs a container adaptor whose internal container is constructed with cntr and alloc as arguments.
move-initialization with allocator constructor
Constructs a container adaptor whose internal container is constructed with std::move(cntr) and alloc as arguments.
copy with allocator constructor
Constructs a container adaptor whose internal container is constructed with x's internal container as first argument and alloc as second.
move with allocator constructor
Constructs a container adaptor whose internal container is constructed by moving x's internal container as first argument and passing alloc as second.
stack.size()
stack.size()
stack.push()
stack.push()
Parameters
val: Value to which the inserted element is initialized. Member type value_type is the type of the elements in the container (defined as an alias of the first class template parameter, T
).
stack.empty()
stack.empty()
stack.top()
stack.top()
C++ | string
string.length()
string.length()
Last updated