Constructors

Synopses

Declared in <bslstl_deque.h>

Create an empty deque. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default‐constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used.

deque();

Create a deque that has the same value as the specified original object. Use the allocator returned by 'bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())' to supply memory. If the (template parameter) type ALLOCATOR is bsl::allocator (the default), the currently installed default allocator is used. This method requires that the (template parameter) VALUE_TYPE be copy‐insertable into this deque (see {Requirements on VALUE_TYPE}).

deque(deque const& original);

Create a deque having the same value as the specified original object by moving (in constant time) the contents of original to the new deque. The allocator associated with original is propagated for use in the newly‐created deque. original is left in a valid but unspecified state.

Same as the related overload above for deque.

explicit
deque(ALLOCATOR const& basicAllocator);

Create a deque of the specified numElements size whose every element is value‐initialized. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default‐constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE_TYPE be default‐insertable into this deque (see {Requirements on VALUE_TYPE}).

explicit
deque(
    size_type numElements,
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Create a deque having the same value as the specified original object that uses the specified basicAllocator to supply memory. The contents of original are moved (in constant time) to the new deque if basicAllocator == original.get_allocator(), and are move‐ inserted (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state. This method requires that the (template parameter) VALUE_TYPE be move‐insertable into this deque (see {Requirements on VALUE_TYPE}). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).

deque(
    BloombergLP::bslmf::MovableRef<deque> original,
    ALLOCATOR const& basicAllocator);

Create a deque and append each value_type object in the specified values initializer list. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default‐constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. This method requires that the (template parameter) VALUE_TYPE be copy‐insertable into this deque (see {Requirements on VALUE_TYPE}).

deque(
    std::initializer_list<value_type> values,
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Create a deque that has the same value as the specified original object and that uses the specified basicAllocator to supply memory. This method requires that the (template parameter) VALUE_TYPE be copy‐insertable into this deque (see {Requirements on VALUE_TYPE}). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) type ALLOCATOR is bsl::allocator (the default).

deque(
    deque const& original,
    ALLOCATOR const& basicAllocator);

Create a deque of the specified numElements size whose every element has the specified value. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default‐constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE_TYPE be copy‐insertable into this deque (see {Requirements on VALUE_TYPE}).

deque(
    size_type numElements,
    VALUE_TYPE const& value,
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Create a deque initially containing copies of the values in the range starting at the specified first and ending immediately before the specified last iterators of the (template parameter) type INPUT_ITERATOR. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default‐constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if the number of elements in [first .. last)] exceeds the size returned by max_size. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators]providing access to values of a type convertible to value_type, and value_type must be emplace‐constructible from *i into this deque, where i is a dereferenceable iterator in the range [first .. last)] (see {Requirements on VALUE_TYPE}). The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

template<class INPUT_ITERATOR>
deque(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last,
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Create a deque from the elements of the specifed range. Optionally specify an basicAllocator used to supply memory. If basicAllocator is not specified, a default‐constructed object of the (template parameter) type 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_TYPE.

template<class t_RANGE>
deque(
    std::from_range_t,
    t_RANGE&& range,
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Created with MrDocs