8#ifndef INCLUDED_BSLSTL_QUEUE
9#define INCLUDED_BSLSTL_QUEUE
256#include <bslscm_version.h>
281#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
285# define COMPILING_BSLSTL_QUEUE_H
287# undef COMPILING_BSLSTL_QUEUE_H
303template <
class VALUE,
class CONTAINER = deque<VALUE> >
306#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
312 template <
class VALUE2,
class CONTAINER2>
316 template <
class VALUE2,
class CONTAINER2>
320 template <
class VALUE2,
class CONTAINER2>
324 template <
class VALUE2,
class CONTAINER2>
328 template <
class VALUE2,
class CONTAINER2>
332 template <
class VALUE2,
class CONTAINER2>
336#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
337 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
338 template <
class VALUE2, three_way_comparable CONTAINER2>
339 friend compare_three_way_result_t<CONTAINER2>
348 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
367 BloombergLP::bslma::UsesBslmaAllocator,
368 BloombergLP::bslma::UsesBslmaAllocator<container_type>::value);
383 queue(BloombergLP::bslmf::MovableRef<queue> container);
387 explicit queue(
const CONTAINER& container);
393 explicit queue(BloombergLP::bslmf::MovableRef<CONTAINER> container);
400 template <
class ALLOCATOR>
402 queue(
const ALLOCATOR& basicAllocator,
404 ALLOCATOR>::type * = 0);
412 template <
class ALLOCATOR>
414 const ALLOCATOR& basicAllocator,
416 ALLOCATOR>::type * = 0);
424 template <
class ALLOCATOR>
426 const ALLOCATOR& basicAllocator,
428 ALLOCATOR>::type * = 0);
440 template <
class ALLOCATOR>
441 queue(BloombergLP::bslmf::MovableRef<CONTAINER> container,
442 const ALLOCATOR& basicAllocator,
444 ALLOCATOR>::type * = 0);
456 template <
class ALLOCATOR>
457 queue(BloombergLP::bslmf::MovableRef<queue> original,
458 const ALLOCATOR& basicAllocator,
460 ALLOCATOR>::type * = 0);
476#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
482 template <
class... Args>
495 void push(BloombergLP::bslmf::MovableRef<value_type> value);
502 bsl::is_nothrow_swappable<CONTAINER>::value);
534#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
541template<
class CONTAINER,
542 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<CONTAINER>>
553 class = bsl::enable_if_t<bsl::uses_allocator_v<CONTAINER, ALLOCATOR>>
567template <
class VALUE,
class CONTAINER>
579template <
class VALUE,
class CONTAINER>
594template <
class VALUE,
class CONTAINER>
605template <
class VALUE,
class CONTAINER>
616template <
class VALUE,
class CONTAINER>
627template <
class VALUE,
class CONTAINER>
635template <
class VALUE,
class CONTAINER>
649template <
class VALUE,
class CONTAINER>
655template <
class VALUE,
class CONTAINER>
662template <
class VALUE,
class CONTAINER>
665: c(MoveUtil::move(MoveUtil::access(original).c))
669template <
class VALUE,
class CONTAINER>
676template <
class VALUE,
class CONTAINER>
677template <
class ALLOCATOR>
680 const ALLOCATOR& basicAllocator,
687template <
class VALUE,
class CONTAINER>
688template <
class ALLOCATOR>
691 const CONTAINER& container,
692 const ALLOCATOR& basicAllocator,
695: c(container, basicAllocator)
699template <
class VALUE,
class CONTAINER>
700template <
class ALLOCATOR>
704 const ALLOCATOR& basicAllocator,
707: c(
queue.c, basicAllocator)
711template <
class VALUE,
class CONTAINER>
715: c(MoveUtil::move(container))
719template <
class VALUE,
class CONTAINER>
720template <
class ALLOCATOR>
723 BloombergLP::bslmf::MovableRef<CONTAINER> container,
724 const ALLOCATOR& basicAllocator,
727: c(MoveUtil::move(container), basicAllocator)
731template <
class VALUE,
class CONTAINER>
732template <
class ALLOCATOR>
735 BloombergLP::bslmf::MovableRef<queue> original,
736 const ALLOCATOR& basicAllocator,
739: c(MoveUtil::move(MoveUtil::access(original).c), basicAllocator)
744template <
class VALUE,
class CONTAINER>
752template <
class VALUE,
class CONTAINER>
755 BloombergLP::bslmf::MovableRef<queue> rhs)
757 c = MoveUtil::move(MoveUtil::access(rhs).c);
761#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
762template <
class VALUE,
class CONTAINER>
763template <
class... Args>
773template <
class VALUE,
class CONTAINER>
780template <
class VALUE,
class CONTAINER>
785 c.push_back(MoveUtil::move(value));
788template <
class VALUE,
class CONTAINER>
795template <
class VALUE,
class CONTAINER>
799 bsl::is_nothrow_swappable<CONTAINER>::value)
801 BloombergLP::bslalg::SwapUtil::swap(&c, &other.c);
805template <
class VALUE,
class CONTAINER>
812template <
class VALUE,
class CONTAINER>
820template <
class VALUE,
class CONTAINER>
828template <
class VALUE,
class CONTAINER>
836template <
class VALUE,
class CONTAINER>
844template <
class VALUE,
class CONTAINER>
853template <
class VALUE,
class CONTAINER>
858 return lhs.
c == rhs.
c;
861template <
class VALUE,
class CONTAINER>
866 return lhs.
c != rhs.
c;
869template <
class VALUE,
class CONTAINER>
874 return lhs.
c < rhs.
c;
877template <
class VALUE,
class CONTAINER>
882 return lhs.
c > rhs.
c;
885template <
class VALUE,
class CONTAINER>
890 return lhs.
c <= rhs.
c;
893template <
class VALUE,
class CONTAINER>
898 return lhs.
c >= rhs.
c;
901#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
902 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
903template <
class VALUE, three_way_comparable CONTAINER>
904inline compare_three_way_result_t<CONTAINER>
905operator<=>(
const queue<VALUE, CONTAINER>& lhs,
906 const queue<VALUE, CONTAINER>& rhs)
908 return lhs.c <=> rhs.c;
913template <
class VALUE,
class CONTAINER>
Definition bslstl_queue.h:304
void push(BloombergLP::bslmf::MovableRef< value_type > value)
Definition bslstl_queue.h:782
queue(const queue &original)
Create a queue having the value of the specified original.
Definition bslstl_queue.h:657
friend bool operator==(const queue< VALUE2, CONTAINER2 > &, const queue< VALUE2, CONTAINER2 > &)
const_reference back() const
Definition bslstl_queue.h:847
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
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:352
queue(BloombergLP::bslmf::MovableRef< queue > container)
Definition bslstl_queue.h:664
const_reference front() const
void push(const value_type &value)
Definition bslstl_queue.h:775
queue(BloombergLP::bslmf::MovableRef< CONTAINER > container)
Definition bslstl_queue.h:713
queue(const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:679
queue(const CONTAINER &container)
Definition bslstl_queue.h:671
CONTAINER::size_type size_type
Definition bslstl_queue.h:355
queue & operator=(BloombergLP::bslmf::MovableRef< queue > rhs)
Definition bslstl_queue.h:754
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:722
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
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:734
queue(const queue &original, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:702
CONTAINER container_type
Definition bslstl_queue.h:356
queue(const CONTAINER &container, const ALLOCATOR &basicAllocator, typename enable_if< bsl::uses_allocator< CONTAINER, ALLOCATOR >::value, ALLOCATOR >::type *=0)
Definition bslstl_queue.h:690
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
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:634
Definition bdlb_printmethods.h:283
Definition bslmf_enableif.h:525
Definition bslmf_issame.h:146
Definition bslmf_usesallocator.h:165