Constructors
Synopses
Declared in <bslstl_stack.h>
Create an empty stack. No allocator will be provided to the underlying container. That container's memory allocation will be provided by the default allocator of its type.
explicit
stack();
Create a stack having the value of the specified original. The currently installed default allocator is used to supply memory.
Create a stack whose underlying container has the value of the specified container (on entry) by moving the contents of container to the new stack. The allocator associated with container is propagated for use in the new stack. container is left in a valid but unspecified state.
explicit
stack(BloombergLP::bslmf::MovableRef<CONTAINER> container);
Create a stack having the value of the specified original by moving the contents of original to the new stack. The allocator associated with original is propagated for use in the new stack. original is left in a valid but unspecified state.
stack(BloombergLP::bslmf::MovableRef<stack> original);
Create a stack whose underlying container has the value of the specified container. The currently installed default allocator is used to supply memory.
explicit
stack(CONTAINER const& container);
Create a stack passing the specified first and last to the constructor of the underlying container. Optionally specify an allocator used to supply memory. If allocator is not specified, a default‐constructed object of the (template parameter) type ALLOCATOR is used.
template<class INPUT_ITER>
stack(
INPUT_ITER first,
INPUT_ITER last);
Create a stack from the elements of the specifed range. Optionally specify an allocator used to supply memory. If allocator is not specified, a default‐constructed object of the (template parameter) type t_ALLOCATOR is used. Note that range must meet the requirements of an input range and the values from range must have a type matching or convertible to (template parameter) VALUE.
template<class t_RANGE>
stack(
std::from_range_t,
t_RANGE&& range);
Create an empty stack, and use the specified basicAllocator to supply memory. If CONTAINER::allocator_type does not exist, this constructor may not be used.
template<class ALLOCATOR>
explicit
stack(
ALLOCATOR const& basicAllocator,
ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;
Create a stack whose underlying container has the value of the specified container (on entry) that uses basicAllocator to supply memory by using the allocator‐extended move constructor of CONTAINER. `container' is left in a valid but unspecified state. A `bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default). This method assumes that CONTAINER has a move constructor. If CONTAINER::allocator_type does not exist, this constructor may not be used.
template<class ALLOCATOR>
stack(
BloombergLP::bslmf::MovableRef<CONTAINER> container,
ALLOCATOR const& basicAllocator,
ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;
Create a stack having the value of the specified original (on entry) that uses basicAllocator to supply memory by using the allocator‐extended moved constructor of CONTAINER. original is left in a valid but unspecified state. Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default). Also note that this method assumes that CONTAINER has a move constructor. Also note that if CONTAINER::allocator_type does not exist, this constructor may not be used.
template<class ALLOCATOR>
stack(
BloombergLP::bslmf::MovableRef<stack> original,
ALLOCATOR const& basicAllocator,
ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;
Create a stack whose underlying container has the value of the specified container, and use the specified basicAllocator to supply memory. If CONTAINER::allocator_type does not exist, this constructor may not be used.
template<class ALLOCATOR>
stack(
CONTAINER const& container,
ALLOCATOR const& basicAllocator,
ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;
Create a stack having the value of the specified stack original and use the specified basicAllocator to supply memory. If CONTAINER::allocator_type does not exist, this constructor may not be used.
Same as the related overload above for stack.
template<
class INPUT_ITER,
class ALLOCATOR>
stack(
INPUT_ITER first,
INPUT_ITER last,
ALLOCATOR const& allocator,
ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;
Same as the preceding overload.
template<
class t_RANGE,
class t_ALLOCATOR>
stack(
std::from_range_t,
t_RANGE&& range,
t_ALLOCATOR const& allocator,
t_ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER,t_ALLOCATOR>::value;
Created with MrDocs