8#ifndef INCLUDED_BSLSTL_QUEUE
9#define INCLUDED_BSLSTL_QUEUE
260#include <bslscm_version.h>
289#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
290 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
291# define BSLSTL_QUEUE_REQUIRES_CONTAINER_COMPATIBLE_RANGE(R, T) \
292 requires ::BloombergLP::bslmf::ContainerCompatibleRange<R, T>
294# define BSLSTL_QUEUE_REQUIRES_CONTAINER_COMPATIBLE_RANGE(R, T)
297#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
303# define COMPILING_BSLSTL_QUEUE_H
305# undef COMPILING_BSLSTL_QUEUE_H
323template <
class VALUE,
class CONTAINER = deque<VALUE> >
326#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
332 template <
class VALUE2,
class CONTAINER2>
336 template <
class VALUE2,
class CONTAINER2>
340 template <
class VALUE2,
class CONTAINER2>
344 template <
class VALUE2,
class CONTAINER2>
348 template <
class VALUE2,
class CONTAINER2>
352 template <
class VALUE2,
class CONTAINER2>
356#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
357 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
358 template <
class VALUE2, three_way_comparable CONTAINER2>
359 friend compare_three_way_result_t<CONTAINER2>
368 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
374 template <
class INPUT_ITER,
class SENTINEL>
375 void privatePushRange(INPUT_ITER first, SENTINEL last);
394 BloombergLP::bslma::UsesBslmaAllocator,
395 BloombergLP::bslma::UsesBslmaAllocator<container_type>::value);
410 queue(BloombergLP::bslmf::MovableRef<queue> container);
414 explicit queue(
const CONTAINER& container);
420 explicit queue(BloombergLP::bslmf::MovableRef<CONTAINER> container);
428 template <
class ALLOCATOR>
430 queue(
const ALLOCATOR& basicAllocator,
432 ALLOCATOR>::type * = 0);
441 template <
class ALLOCATOR>
443 const ALLOCATOR& basicAllocator,
445 ALLOCATOR>::type * = 0);
454 template <
class ALLOCATOR>
456 const ALLOCATOR& basicAllocator,
458 ALLOCATOR>::type * = 0);
471 template <
class ALLOCATOR>
472 queue(BloombergLP::bslmf::MovableRef<CONTAINER> container,
473 const ALLOCATOR& basicAllocator,
475 ALLOCATOR>::type * = 0);
488 template <
class ALLOCATOR>
489 queue(BloombergLP::bslmf::MovableRef<queue> original,
490 const ALLOCATOR& basicAllocator,
492 ALLOCATOR>::type * = 0);
499 template <
class INPUT_ITER>
500 queue(INPUT_ITER first, INPUT_ITER last);
501 template <
class INPUT_ITER,
class ALLOCATOR>
506 ALLOCATOR>::type * = 0);
515 template <
class t_RANGE>
518 template <class t_RANGE, class t_ALLOCATOR>
524 t_ALLOCATOR>::type * = 0);
540#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
546 template <
class... Args>
558 void push(BloombergLP::bslmf::MovableRef<value_type> value);
565 template <
class t_RANGE>
577 bsl::is_nothrow_swappable<CONTAINER>::value);
606#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
613template<
class CONTAINER,
614 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<CONTAINER>>
625 class = bsl::enable_if_t<bsl::uses_allocator_v<CONTAINER, ALLOCATOR>>
631template <
class INPUT_ITER,
632 class TYPE = BloombergLP::bslstl::IteratorUtil::
633 IterVal_t<INPUT_ITER>>
640template <
class INPUT_ITER,
642 class TYPE = BloombergLP::bslstl::IteratorUtil::
643 IterVal_t<INPUT_ITER>,
644 class = enable_if_t<IsStdAllocator_v<ALLOCATOR>>>
647#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
648 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
651template <ranges::input_range t_RANGE>
658template <ranges::input_range t_RANGE,
660 class t_TYPE = ranges::range_value_t<t_RANGE>>
661requires IsStdAllocator_v<t_ALLOCATOR>
676template <
class VALUE,
class CONTAINER>
688template <
class VALUE,
class CONTAINER>
703template <
class VALUE,
class CONTAINER>
715template <
class VALUE,
class CONTAINER>
727template <
class VALUE,
class CONTAINER>
739template <
class VALUE,
class CONTAINER>
747template <
class VALUE,
class CONTAINER>
761template <
class VALUE,
class CONTAINER>
767template <
class VALUE,
class CONTAINER>
774template <
class VALUE,
class CONTAINER>
777: c(MoveUtil::move(MoveUtil::access(original).c))
781template <
class VALUE,
class CONTAINER>
788template <
class VALUE,
class CONTAINER>
789template <
class ALLOCATOR>
792 const ALLOCATOR& basicAllocator,
799template <
class VALUE,
class CONTAINER>
800template <
class ALLOCATOR>
803 const CONTAINER& container,
804 const ALLOCATOR& basicAllocator,
807: c(container, basicAllocator)
811template <
class VALUE,
class CONTAINER>
812template <
class ALLOCATOR>
816 const ALLOCATOR& basicAllocator,
819: c(
queue.c, basicAllocator)
823template <
class VALUE,
class CONTAINER>
827: c(MoveUtil::move(container))
831template <
class VALUE,
class CONTAINER>
832template <
class ALLOCATOR>
835 BloombergLP::bslmf::MovableRef<CONTAINER> container,
836 const ALLOCATOR& basicAllocator,
839: c(MoveUtil::move(container), basicAllocator)
843template <
class VALUE,
class CONTAINER>
844template <
class ALLOCATOR>
847 BloombergLP::bslmf::MovableRef<queue> original,
848 const ALLOCATOR& basicAllocator,
851: c(MoveUtil::move(MoveUtil::access(original).c), basicAllocator)
855template <
class VALUE,
class CONTAINER>
856template <
class INPUT_ITER>
863template <
class VALUE,
class CONTAINER>
864template <
class INPUT_ITER,
class ALLOCATOR>
876template <
class VALUE,
class CONTAINER>
877template <
class t_RANGE>
883#ifdef BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER
884: c(ranges::to<CONTAINER>(std::forward<t_RANGE>(range)))
891template <
class VALUE,
class CONTAINER>
892template <
class t_RANGE,
class t_ALLOCATOR>
901 t_ALLOCATOR>::type *)
902#ifdef BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER
903: c(ranges::to<CONTAINER>(std::forward<t_RANGE>(range),
allocator))
911template <
class VALUE,
class CONTAINER>
912template <
class INPUT_ITER,
class SENTINEL>
917 while (first != last) {
924template <
class VALUE,
class CONTAINER>
932template <
class VALUE,
class CONTAINER>
935 BloombergLP::bslmf::MovableRef<queue>
rhs)
937 c = MoveUtil::move(MoveUtil::access(
rhs).c);
941#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
942template <
class VALUE,
class CONTAINER>
943template <
class... Args>
953template <
class VALUE,
class CONTAINER>
960template <
class VALUE,
class CONTAINER>
965 c.push_back(MoveUtil::move(value));
968template <
class VALUE,
class CONTAINER>
969template <
class t_RANGE>
971void
queue<VALUE, CONTAINER>::push_range(
974#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
975 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
976 if constexpr (
requires{ c.append_range(std::forward<t_RANGE>(range)); }) {
977 c.append_range(std::forward<t_RANGE>(range));
980 ranges::copy(range, back_inserter(c));
987template <
class VALUE,
class CONTAINER>
994template <
class VALUE,
class CONTAINER>
998 bsl::is_nothrow_swappable<CONTAINER>::value)
1000 BloombergLP::bslalg::SwapUtil::swap(&c, &other.c);
1004template <
class VALUE,
class CONTAINER>
1011template <
class VALUE,
class CONTAINER>
1019template <
class VALUE,
class CONTAINER>
1027template <
class VALUE,
class CONTAINER>
1035template <
class VALUE,
class CONTAINER>
1043template <
class VALUE,
class CONTAINER>
1052template <
class VALUE,
class CONTAINER>
1060template <
class VALUE,
class CONTAINER>
1068template <
class VALUE,
class CONTAINER>
1076template <
class VALUE,
class CONTAINER>
1084template <
class VALUE,
class CONTAINER>
1092template <
class VALUE,
class CONTAINER>
1100#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
1101 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1102template <
class VALUE, three_way_comparable CONTAINER>
1103inline compare_three_way_result_t<CONTAINER>
1104operator<=>(
const queue<VALUE, CONTAINER>&
lhs,
1105 const queue<VALUE, CONTAINER>&
rhs)
1112template <
class VALUE,
class CONTAINER>
1125#undef BSLSTL_QUEUE_REQUIRES_CONTAINER_COMPATIBLE_RANGE
Definition bslma_bslallocator.h:588
Definition bslstl_queue.h:324
void push(BloombergLP::bslmf::MovableRef< value_type > value)
Definition bslstl_queue.h:962
queue(const queue &original)
Create a queue having the value of the specified original.
Definition bslstl_queue.h:769
friend bool operator==(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
void pop()
Definition bslstl_queue.h:989
CONTAINER::const_reference const_reference
Definition bslstl_queue.h:381
size_type size() const
Definition bslstl_queue.h:1014
friend bool operator<=(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
queue()
Definition bslstl_queue.h:763
bool empty() const
Definition bslstl_queue.h:1006
BSLMF_NESTED_TRAIT_DECLARATION_IF(queue, BloombergLP::bslma::UsesBslmaAllocator, BloombergLP::bslma::UsesBslmaAllocator< container_type >::value)
friend bool operator>=(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
friend bool operator!=(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
CONTAINER::value_type value_type
Definition bslstl_queue.h:379
void push_range(BSLS_COMPILERFEATURES_FORWARD_REF(t_RANGE) range)
Definition bslstl_queue.h:971
queue(BloombergLP::bslmf::MovableRef< queue > container)
Definition bslstl_queue.h:776
void push(const value_type &value)
Definition bslstl_queue.h:955
queue(BloombergLP::bslmf::MovableRef< CONTAINER > container)
Definition bslstl_queue.h:825
queue(const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:791
queue(const CONTAINER &container)
Definition bslstl_queue.h:783
CONTAINER::size_type size_type
Definition bslstl_queue.h:382
queue(BloombergLP::bslmf::MovableRef< CONTAINER > container, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:834
queue & operator=(const queue &rhs)
Definition bslstl_queue.h:926
void swap(queue &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl reference front()
Definition bslstl_queue.h:581
reference back()
Definition bslstl_queue.h:1038
queue(BloombergLP::bslmf::MovableRef< queue > original, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:846
queue(INPUT_ITER first, INPUT_ITER last, const ALLOCATOR &allocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:866
queue(const queue &original, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:814
CONTAINER container_type
Definition bslstl_queue.h:383
queue(const CONTAINER &container, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:802
queue(INPUT_ITER first, INPUT_ITER last)
Definition bslstl_queue.h:858
CONTAINER::reference reference
Definition bslstl_queue.h:380
friend bool operator<(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
friend bool operator>(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
reference emplace(Args &&... args)
Definition bslstl_queue.h:946
CONTAINER c
Definition bslstl_queue.h:387
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2343
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2349
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:676
#define BSLSTL_QUEUE_REQUIRES_CONTAINER_COMPATIBLE_RANGE(R, T)
Definition bslstl_queue.h:294
Definition bdlat_valuetypefunctions.h:939
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
T::iterator begin(T &container)
Definition bslstl_iterator.h:1593
const from_range_t from_range
ALLOCATOR & lhs
Definition bslstl_string.h:3917
T::iterator end(T &container)
Definition bslstl_iterator.h:1621
Definition bdlbb_blob.h:579
Definition bslmf_enableif.h:530
Definition bslstl_ranges.h:301
Definition bslmf_issame.h:146
Definition bslmf_usesallocator.h:165