11#ifndef INCLUDED_BSLSTL_QUEUE_CPP03
12#define INCLUDED_BSLSTL_QUEUE_CPP03
63#ifdef COMPILING_BSLSTL_QUEUE_H
78template <
class VALUE,
class CONTAINER = deque<VALUE> >
81#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
87 template <
class VALUE2,
class CONTAINER2>
88 friend bool operator==(
const queue<VALUE2, CONTAINER2>&,
89 const queue<VALUE2, CONTAINER2>&);
91 template <
class VALUE2,
class CONTAINER2>
92 friend bool operator!=(
const queue<VALUE2, CONTAINER2>&,
93 const queue<VALUE2, CONTAINER2>&);
95 template <
class VALUE2,
class CONTAINER2>
96 friend bool operator< (
const queue<VALUE2, CONTAINER2>&,
97 const queue<VALUE2, CONTAINER2>&);
99 template <
class VALUE2,
class CONTAINER2>
100 friend bool operator> (
const queue<VALUE2, CONTAINER2>&,
101 const queue<VALUE2, CONTAINER2>&);
103 template <
class VALUE2,
class CONTAINER2>
104 friend bool operator<=(
const queue<VALUE2, CONTAINER2>&,
105 const queue<VALUE2, CONTAINER2>&);
107 template <
class VALUE2,
class CONTAINER2>
108 friend bool operator>=(
const queue<VALUE2, CONTAINER2>&,
109 const queue<VALUE2, CONTAINER2>&);
111#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
112 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
113 template <
class VALUE2, three_way_comparable CONTAINER2>
114 friend compare_three_way_result_t<CONTAINER2>
115 operator<=>(
const queue<VALUE2, CONTAINER2>&,
116 const queue<VALUE2, CONTAINER2>&);
123 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
127 typedef typename CONTAINER::value_type
value_type;
128 typedef typename CONTAINER::reference
reference;
130 typedef typename CONTAINER::size_type
size_type;
142 BloombergLP::bslma::UsesBslmaAllocator,
143 BloombergLP::bslma::UsesBslmaAllocator<container_type>::value);
158 queue(BloombergLP::bslmf::MovableRef<queue> container);
162 explicit queue(
const CONTAINER& container);
168 explicit queue(BloombergLP::bslmf::MovableRef<CONTAINER> container);
175 template <
class ALLOCATOR>
177 queue(
const ALLOCATOR& basicAllocator,
179 ALLOCATOR>::type * = 0);
187 template <
class ALLOCATOR>
188 queue(
const CONTAINER& container,
189 const ALLOCATOR& basicAllocator,
191 ALLOCATOR>::type * = 0);
199 template <
class ALLOCATOR>
201 const ALLOCATOR& basicAllocator,
203 ALLOCATOR>::type * = 0);
215 template <
class ALLOCATOR>
216 queue(BloombergLP::bslmf::MovableRef<CONTAINER> container,
217 const ALLOCATOR& basicAllocator,
219 ALLOCATOR>::type * = 0);
231 template <
class ALLOCATOR>
232 queue(BloombergLP::bslmf::MovableRef<queue> original,
233 const ALLOCATOR& basicAllocator,
235 ALLOCATOR>::type * = 0);
251#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
254#ifndef BSLSTL_QUEUE_VARIADIC_LIMIT
255#define BSLSTL_QUEUE_VARIADIC_LIMIT 10
257#ifndef BSLSTL_QUEUE_VARIADIC_LIMIT_A
258#define BSLSTL_QUEUE_VARIADIC_LIMIT_A BSLSTL_QUEUE_VARIADIC_LIMIT
260#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 0
264#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 1
265 template <
class Args_01>
269#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 2
270 template <
class Args_01,
276#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 3
277 template <
class Args_01,
285#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 4
286 template <
class Args_01,
296#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 5
297 template <
class Args_01,
309#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 6
310 template <
class Args_01,
324#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 7
325 template <
class Args_01,
341#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 8
342 template <
class Args_01,
360#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 9
361 template <
class Args_01,
381#if BSLSTL_QUEUE_VARIADIC_LIMIT_A >= 10
382 template <
class Args_01,
407 template <
class... Args>
421 void push(BloombergLP::bslmf::MovableRef<value_type> value);
428 bsl::is_nothrow_swappable<CONTAINER>::value);
460#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
467template<
class CONTAINER,
468 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<CONTAINER>>
470queue(CONTAINER) -> queue<typename CONTAINER::value_type, CONTAINER>;
479 class = bsl::enable_if_t<bsl::uses_allocator_v<CONTAINER, ALLOCATOR>>
481queue(CONTAINER, ALLOCATOR) -> queue<typename CONTAINER::value_type, CONTAINER>;
493template <
class VALUE,
class CONTAINER>
494bool operator==(
const queue<VALUE, CONTAINER>& lhs,
495 const queue<VALUE, CONTAINER>& rhs);
505template <
class VALUE,
class CONTAINER>
506bool operator!=(
const queue<VALUE, CONTAINER>& lhs,
507 const queue<VALUE, CONTAINER>& rhs);
520template <
class VALUE,
class CONTAINER>
521bool operator< (
const queue<VALUE, CONTAINER>& lhs,
522 const queue<VALUE, CONTAINER>& rhs);
531template <
class VALUE,
class CONTAINER>
532bool operator> (
const queue<VALUE, CONTAINER>& lhs,
533 const queue<VALUE, CONTAINER>& rhs);
542template <
class VALUE,
class CONTAINER>
543bool operator<=(
const queue<VALUE, CONTAINER>& lhs,
544 const queue<VALUE, CONTAINER>& rhs);
553template <
class VALUE,
class CONTAINER>
554bool operator>=(
const queue<VALUE, CONTAINER>& lhs,
555 const queue<VALUE, CONTAINER>& rhs);
561template <
class VALUE,
class CONTAINER>
562void swap(queue<VALUE, CONTAINER>& lhs,
563 queue<VALUE, CONTAINER>& rhs)
575template <
class VALUE,
class CONTAINER>
581template <
class VALUE,
class CONTAINER>
588template <
class VALUE,
class CONTAINER>
590queue<VALUE, CONTAINER>::queue(BloombergLP::bslmf::MovableRef<queue> original)
591: c(MoveUtil::move(MoveUtil::access(original).c))
595template <
class VALUE,
class CONTAINER>
597queue<VALUE, CONTAINER>::queue(
const CONTAINER& container)
602template <
class VALUE,
class CONTAINER>
603template <
class ALLOCATOR>
605queue<VALUE, CONTAINER>::queue(
606 const ALLOCATOR& basicAllocator,
613template <
class VALUE,
class CONTAINER>
614template <
class ALLOCATOR>
616queue<VALUE, CONTAINER>::queue(
617 const CONTAINER& container,
618 const ALLOCATOR& basicAllocator,
621: c(container, basicAllocator)
625template <
class VALUE,
class CONTAINER>
626template <
class ALLOCATOR>
628queue<VALUE, CONTAINER>::queue(
630 const ALLOCATOR& basicAllocator,
633: c(queue.c, basicAllocator)
637template <
class VALUE,
class CONTAINER>
639queue<VALUE, CONTAINER>::queue(BloombergLP::bslmf::MovableRef<CONTAINER>
641: c(MoveUtil::move(container))
645template <
class VALUE,
class CONTAINER>
646template <
class ALLOCATOR>
648queue<VALUE, CONTAINER>::queue(
649 BloombergLP::bslmf::MovableRef<CONTAINER> container,
650 const ALLOCATOR& basicAllocator,
653: c(MoveUtil::move(container), basicAllocator)
657template <
class VALUE,
class CONTAINER>
658template <
class ALLOCATOR>
660queue<VALUE, CONTAINER>::queue(
661 BloombergLP::bslmf::MovableRef<queue> original,
662 const ALLOCATOR& basicAllocator,
665: c(MoveUtil::move(MoveUtil::access(original).c), basicAllocator)
670template <
class VALUE,
class CONTAINER>
672queue<VALUE, CONTAINER>& queue<VALUE, CONTAINER>::operator=(
const queue& rhs)
678template <
class VALUE,
class CONTAINER>
680queue<VALUE, CONTAINER>& queue<VALUE, CONTAINER>::operator=(
681 BloombergLP::bslmf::MovableRef<queue> rhs)
683 c = MoveUtil::move(MoveUtil::access(rhs).c);
687#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
690#ifndef BSLSTL_QUEUE_VARIADIC_LIMIT
691#define BSLSTL_QUEUE_VARIADIC_LIMIT 10
693#ifndef BSLSTL_QUEUE_VARIADIC_LIMIT_B
694#define BSLSTL_QUEUE_VARIADIC_LIMIT_B BSLSTL_QUEUE_VARIADIC_LIMIT
696#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 0
697template <
class VALUE,
class CONTAINER>
699typename queue<VALUE, CONTAINER>::reference
700queue<VALUE, CONTAINER>::emplace(
708#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 1
709template <
class VALUE,
class CONTAINER>
710template <
class Args_01>
712typename queue<VALUE, CONTAINER>::reference
713queue<VALUE, CONTAINER>::emplace(
721#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 2
722template <
class VALUE,
class CONTAINER>
723template <
class Args_01,
726typename queue<VALUE, CONTAINER>::reference
727queue<VALUE, CONTAINER>::emplace(
737#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 3
738template <
class VALUE,
class CONTAINER>
739template <
class Args_01,
743typename queue<VALUE, CONTAINER>::reference
744queue<VALUE, CONTAINER>::emplace(
756#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 4
757template <
class VALUE,
class CONTAINER>
758template <
class Args_01,
763typename queue<VALUE, CONTAINER>::reference
764queue<VALUE, CONTAINER>::emplace(
778#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 5
779template <
class VALUE,
class CONTAINER>
780template <
class Args_01,
786typename queue<VALUE, CONTAINER>::reference
787queue<VALUE, CONTAINER>::emplace(
803#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 6
804template <
class VALUE,
class CONTAINER>
805template <
class Args_01,
812typename queue<VALUE, CONTAINER>::reference
813queue<VALUE, CONTAINER>::emplace(
831#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 7
832template <
class VALUE,
class CONTAINER>
833template <
class Args_01,
841typename queue<VALUE, CONTAINER>::reference
842queue<VALUE, CONTAINER>::emplace(
862#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 8
863template <
class VALUE,
class CONTAINER>
864template <
class Args_01,
873typename queue<VALUE, CONTAINER>::reference
874queue<VALUE, CONTAINER>::emplace(
896#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 9
897template <
class VALUE,
class CONTAINER>
898template <
class Args_01,
908typename queue<VALUE, CONTAINER>::reference
909queue<VALUE, CONTAINER>::emplace(
933#if BSLSTL_QUEUE_VARIADIC_LIMIT_B >= 10
934template <
class VALUE,
class CONTAINER>
935template <
class Args_01,
946typename queue<VALUE, CONTAINER>::reference
947queue<VALUE, CONTAINER>::emplace(
976template <
class VALUE,
class CONTAINER>
977template <
class... Args>
979typename queue<VALUE, CONTAINER>::reference
980queue<VALUE, CONTAINER>::emplace(
989template <
class VALUE,
class CONTAINER>
991void queue<VALUE, CONTAINER>::push(
const value_type& value)
996template <
class VALUE,
class CONTAINER>
998void queue<VALUE, CONTAINER>::push(BloombergLP::bslmf::MovableRef<value_type>
1001 c.push_back(MoveUtil::move(value));
1004template <
class VALUE,
class CONTAINER>
1006void queue<VALUE, CONTAINER>::pop()
1011template <
class VALUE,
class CONTAINER>
1013void queue<VALUE, CONTAINER>::swap(queue& other)
1015 bsl::is_nothrow_swappable<CONTAINER>::value)
1017 BloombergLP::bslalg::SwapUtil::swap(&c, &other.c);
1021template <
class VALUE,
class CONTAINER>
1023bool queue<VALUE, CONTAINER>::empty()
const
1028template <
class VALUE,
class CONTAINER>
1030typename queue<VALUE, CONTAINER>::size_type
1031queue<VALUE, CONTAINER>::size()
const
1036template <
class VALUE,
class CONTAINER>
1038typename queue<VALUE, CONTAINER>::reference
1039queue<VALUE, CONTAINER>::front()
1044template <
class VALUE,
class CONTAINER>
1046typename queue<VALUE, CONTAINER>::const_reference
1047queue<VALUE, CONTAINER>::front()
const
1052template <
class VALUE,
class CONTAINER>
1054typename queue<VALUE, CONTAINER>::reference
1055queue<VALUE, CONTAINER>::back()
1060template <
class VALUE,
class CONTAINER>
1062typename queue<VALUE, CONTAINER>::const_reference
1063queue<VALUE, CONTAINER>::back()
const
1069template <
class VALUE,
class CONTAINER>
1071bool operator==(
const queue<VALUE, CONTAINER>& lhs,
1072 const queue<VALUE, CONTAINER>& rhs)
1074 return lhs.c == rhs.c;
1077template <
class VALUE,
class CONTAINER>
1079bool operator!=(
const queue<VALUE, CONTAINER>& lhs,
1080 const queue<VALUE, CONTAINER>& rhs)
1082 return lhs.c != rhs.c;
1085template <
class VALUE,
class CONTAINER>
1087bool operator< (
const queue<VALUE, CONTAINER>& lhs,
1088 const queue<VALUE, CONTAINER>& rhs)
1090 return lhs.c < rhs.c;
1093template <
class VALUE,
class CONTAINER>
1095bool operator> (
const queue<VALUE, CONTAINER>& lhs,
1096 const queue<VALUE, CONTAINER>& rhs)
1098 return lhs.c > rhs.c;
1101template <
class VALUE,
class CONTAINER>
1103bool operator<=(
const queue<VALUE, CONTAINER>& lhs,
1104 const queue<VALUE, CONTAINER>& rhs)
1106 return lhs.c <= rhs.c;
1109template <
class VALUE,
class CONTAINER>
1111bool operator>=(
const queue<VALUE, CONTAINER>& lhs,
1112 const queue<VALUE, CONTAINER>& rhs)
1114 return lhs.c >= rhs.c;
1117#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
1118 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
1119template <
class VALUE, three_way_comparable CONTAINER>
1120inline compare_three_way_result_t<CONTAINER>
1121operator<=>(
const queue<VALUE, CONTAINER>& lhs,
1122 const queue<VALUE, CONTAINER>& rhs)
1124 return lhs.c <=> rhs.c;
1129template <
class VALUE,
class CONTAINER>
1131void swap(queue<VALUE, CONTAINER>& lhs,
1132 queue<VALUE, CONTAINER>& rhs)
1141# error Not valid except when included from bslstl_queue.h
#define BSLMF_NESTED_TRAIT_DECLARATION_IF(t_TYPE, t_TRAIT, t_COND)
Definition bslmf_nestedtraitdeclaration.h:243
friend bool operator==(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
void pop()
Definition bslstl_queue.h:790
CONTAINER::const_reference const_reference
Definition bslstl_queue.h:354
size_type size() const
Definition bslstl_queue.h:815
friend bool operator<=(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
queue()
Definition bslstl_queue.h:651
bool empty() const
Definition bslstl_queue.h:807
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:352
void push(const value_type &value)
Definition bslstl_queue.h:775
CONTAINER::size_type size_type
Definition bslstl_queue.h:355
queue & operator=(const queue &rhs)
Definition bslstl_queue.h:746
void swap(queue &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl reference front()
Definition bslstl_queue.h:509
reference back()
Definition bslstl_queue.h:839
CONTAINER container_type
Definition bslstl_queue.h:356
CONTAINER::reference reference
Definition bslstl_queue.h:353
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:766
CONTAINER c
Definition bslstl_queue.h:360
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
static const t_TYPE value
Definition bslmf_integralconstant.h:258
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:634
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
void swap(OptionValue &a, OptionValue &b)
bool operator>=(const Guid &lhs, const Guid &rhs)
bool operator<=(const Guid &lhs, const Guid &rhs)
Definition bdlb_printmethods.h:283
Definition bslmf_usesallocator.h:165