4#ifndef _Stroika_Foundation_Containers_Queue_h_
5#define _Stroika_Foundation_Containers_Queue_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
10#include "Stroika/Foundation/Containers/Common.h"
38 using Traversal::IInputIterator;
39 using Traversal::IIterableOfTo;
40 using Traversal::Iterable;
41 using Traversal::Iterator;
129#if qCompilerAndStdLib_RequiresNotMatchInlineOutOfLineForTemplateClassBeingDefined_Buggy
133 _AssertRepValidType ();
137 template <IInputIterator<T> ITERATOR_OF_ADDABLE>
141 explicit Queue (shared_ptr<_IRep>&& rep)
noexcept;
142 explicit Queue (
const shared_ptr<_IRep>& rep)
noexcept;
254 nonvirtual
void clear ();
296 nonvirtual
void _AssertRepValidType ()
const noexcept;
314 virtual ~_IRep () =
default;
317 virtual shared_ptr<_IRep> CloneEmpty ()
const = 0;
Implementation detail for Queue<T> implementors.
A Queue is a first-in-first-out (FIFO) data structure, where elements are arranged in well-ordered fa...
nonvirtual value_type Head() const
nonvirtual T front() const
nonvirtual void AddAllToTail(ITERABLE_OF_ADDABLE &&s)
nonvirtual void push_back(ArgByValueType< value_type > item)
Add the given item to the end of the Q, so it will be removed last of all the items currently in the ...
nonvirtual void RemoveAll()
nonvirtual value_type Dequeue()
Alias for RemoveHead () - remove item from the head of the Q (line).
nonvirtual optional< value_type > RemoveHeadIf()
typename inherited::value_type value_type
typename Iterable< T >::template SequentialEqualsComparer< T_EQUALS_COMPARER > EqualsComparer
Simply indirect to @Iterable<T>::SequentialEqualsComparer.
nonvirtual value_type RemoveHead()
nonvirtual void Enqueue(ArgByValueType< value_type > item)
add item to the end of the Q (line).
nonvirtual void AddTail(ArgByValueType< value_type > item)
nonvirtual void clear()
STL-ish alias for RemoveAll ().
nonvirtual value_type pop_back()
Implementation detail for iterator implementors.
Iterable<T> is a base class for containers which easily produce an Iterator<T> to traverse them.
nonvirtual CONTAINER_OF_T As(CONTAINER_OF_T_CONSTRUCTOR_ARGS... args) const
T value_type
value_type is an alias for the type iterated over - like vector<T>::value_type
static constexpr default_sentinel_t end() noexcept
Support for ranged for, and STL syntax in general.
conditional_t<(sizeof(CHECK_T)<=2 *sizeof(void *)) and is_trivially_copyable_v< CHECK_T >, CHECK_T, const CHECK_T & > ArgByValueType
This is an alias for 'T' - but how we want to pass it on stack as formal parameter.