[#bsl-queue-0a5-2constructor-09f] = xref:bsl.adoc[bsl]::xref:bsl/queue-0a5.adoc[queue]::queue :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_queue.h>` Create an empty queue having a container of the parameterized `CONTAINER` type. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/queue-0a5/2constructor-0cd.adoc[queue](); ---- [.small]#xref:bsl/queue-0a5/2constructor-0cd.adoc[_» more..._]# Create a queue having the value of the specified `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/queue-0a5/2constructor-0e.adoc[queue](xref:bsl/queue-0a5.adoc[queue] const& original); ---- [.small]#xref:bsl/queue-0a5/2constructor-0e.adoc[_» more..._]# Create a queue having the same sequence of values as the specified `container`. The allocator associated with `container` (if any) is propagated for use in the new queue. `container` is left in valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/queue-0a5/2constructor-0f0.adoc[queue](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<CONTAINER>] container); ---- [.small]#xref:bsl/queue-0a5/2constructor-0f0.adoc[_» more..._]# Create a queue having the value of the specified `original`. The allocator associated with `original` (if any) is propagated for use in the new queue. `original` is left in valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/queue-0a5/2constructor-06.adoc[queue](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<queue>] container); ---- [.small]#xref:bsl/queue-0a5/2constructor-06.adoc[_» more..._]# Create a queue having the specified `container` that holds elements of the parameterized `VALUE` type. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/queue-0a5/2constructor-09a.adoc[queue](CONTAINER const& container); ---- [.small]#xref:bsl/queue-0a5/2constructor-09a.adoc[_» more..._]# Create a queue 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> xref:bsl/queue-0a5/2constructor-0fcd.adoc[queue]( INPUT_ITER first, INPUT_ITER last); ---- [.small]#xref:bsl/queue-0a5/2constructor-0fcd.adoc[_» more..._]# Create a queue 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`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_RANGE> xref:bsl/queue-0a5/2constructor-0fc5.adoc[queue]( std::from_range_t, t_RANGE&& range); ---- [.small]#xref:bsl/queue-0a5/2constructor-0fc5.adoc[_» more..._]# Create an empty queue. This queue object uses the specified `basicAllocator` to supply memory. Note that the `ALLOCATOR` parameter type has to be convertible to the allocator of the `CONTAINER` parameter type, `CONTAINER::allocator_type`; otherwise, this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> explicit xref:bsl/queue-0a5/2constructor-01.adoc[queue]( ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/queue-0a5/2constructor-01.adoc[_» more..._]# Create a queue whose underlying container has the value of the specified `container` (on entry) and uses `basicAllocator` to supply memory. The allocated‐extended move constructor of `CONTAINER` is used to create the new queue. `container` 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 is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/queue-0a5/2constructor-054.adoc[queue]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<CONTAINER>] container, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/queue-0a5/2constructor-054.adoc[_» more..._]# Create a queue having the value of the specified `original` (on entry), that uses `basicAllocator` to supply memory. The allocator‐extended move constructor of `CONTAINER` is used to create the new queue. `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 is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/queue-0a5/2constructor-056.adoc[queue]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<queue>] original, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/queue-0a5/2constructor-056.adoc[_» more..._]# Create a queue having the same sequence of values as the specified `container`. The queue object uses the specified `basicAllocator` to obtain memory. Note that the `ALLOCATOR` parameter type has to be convertible to the allocator of the `CONTAINER` parameter type, `CONTAINER::allocator_type`; otherwise, this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/queue-0a5/2constructor-09d.adoc[queue]( CONTAINER const& container, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/queue-0a5/2constructor-09d.adoc[_» more..._]# Create a queue having the value of the specified `original` that will use the specified `basicAllocator` to supply memory. Note that the `ALLOCATOR` parameter type has to be convertible to the allocator of the `CONTAINER` parameter type, `CONTAINER::allocator_type`. Otherwise this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/queue-0a5/2constructor-0cc.adoc[queue]( xref:bsl/queue-0a5.adoc[queue] const& original, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/queue-0a5/2constructor-0cc.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class INPUT_ITER, class ALLOCATOR> xref:bsl/queue-0a5/2constructor-0b.adoc[queue]( INPUT_ITER first, INPUT_ITER last, ALLOCATOR const& allocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/queue-0a5/2constructor-0b.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_RANGE, class t_ALLOCATOR> xref:bsl/queue-0a5/2constructor-0f5.adoc[queue]( std::from_range_t, t_RANGE&& range, t_ALLOCATOR const& allocator, t_ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER,t_ALLOCATOR>::value; ---- [.small]#xref:bsl/queue-0a5/2constructor-0f5.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#