Constructors
Synopses
Declared in <bslstl_list.h>
Create an empty list. A default‐constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator, the currently installed default allocator is used.
list();
Create a list having 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 allocate memory. This method requires that the (template parameter) type VALUE be copy‐insertable into this list (see {Requirements on VALUE}).
Create a list of the specified numElements size whose every element is default‐constructed. A default‐constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator, the currently installed default allocator is used. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE be default‐insertable into this list (see {Requirements on VALUE}).
explicit
list(size_type numElements);
Create a list having the same value as the specified original object by moving (in constant time) the contents of original to the new list. The allocator associated with original is propagated for use in the newly‐created list. original is left in a valid but unspecified state.
list(BloombergLP::bslmf::MovableRef<list> original);
Create an empty list. Use the specified basicAllocator to supply memory. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator shall be convertible to bslma::Allocator *.
explicit
list(ALLOCATOR const& basicAllocator);
Create a list of the specified numElements size whose every element is default‐constructed. Use the specified basicAllocator to supply memory. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator shall be convertible to bslma::Allocator *. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE be default‐insertable into this list (see {Requirements on VALUE}).
list(
size_type numElements,
ALLOCATOR const& basicAllocator);
Create a list 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 list 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 be move‐insertable into this list (see {Requirements on VALUE}). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).
list(
BloombergLP::bslmf::MovableRef<list> original,
ALLOCATOR const& basicAllocator);
Create a list 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 be copy‐insertable into this list (see {Requirements on VALUE}).
list(
std::initializer_list<value_type> values,
ALLOCATOR const& basicAllocator = ALLOCATOR());
Create a list that has the same value as the specified original object. Use the specified basicAllocator to supply memory. This method requires that the (template parameter) VALUE be copy‐insertable into this list (see {Requirements on VALUE}). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) type ALLOCATOR is bsl::allocator (the default).
Create a list 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 be copy‐insertable into this list (see {Requirements on VALUE}).
list(
size_type numElements,
value_type const& value,
ALLOCATOR const& basicAllocator = ALLOCATOR());
Create a list 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 list, where i is a dereferenceable iterator in the range [first .. last)] (see {Requirements on VALUE}). 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>
list(
INPUT_ITERATOR first,
INPUT_ITERATOR last,
ALLOCATOR const& basicAllocator = ALLOCATOR())
requires !is_arithmetic<INPUT_ITERATOR>::value &&
!is_enum<INPUT_ITERATOR>::value;
Create a list 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.
template<class t_RANGE>
list(
std::from_range_t,
t_RANGE&& range,
ALLOCATOR const& basicAllocator = ALLOCATOR());
Created with MrDocs