Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Deque_DoublyLinkedList.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Containers_Concrete_Deque_DoublyLinkedList_h_
5#define _Stroika_Foundation_Containers_Concrete_Deque_DoublyLinkedList_h_
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include "Stroika/Foundation/Containers/Deque.h"
10
11/**
12 * \file
13 *
14 * \note Code-Status: <a href="Code-Status.md#Beta">Beta</a>
15 *
16 */
17
19
20 /**
21 * \brief Deque_DoublyLinkedList<T> is an Array-based concrete implementation of the Deque<T> container pattern.
22 *
23 * \note \em Thread-Safety <a href="Thread-Safety.md#C++-Standard-Thread-Safety">C++-Standard-Thread-Safety</a>
24 *
25 * \note Runtime performance/complexity:
26 * o size () is O(N), but empty () is constant
27 */
28 template <typename T>
29 class Deque_DoublyLinkedList : public Deque<T> {
30 private:
31 using inherited = Deque<T>;
32
33 public:
34 using value_type = typename inherited::value_type;
35
36 public:
37 /**
38 * \see docs on Deque<T> constructor
39 */
42 Deque_DoublyLinkedList (const Deque_DoublyLinkedList&) noexcept = default;
43 Deque_DoublyLinkedList (const initializer_list<value_type>& src);
44 template <IIterableOfTo<T> ITERABLE_OF_ADDABLE>
45 requires (not derived_from<remove_cvref_t<ITERABLE_OF_ADDABLE>, Deque_DoublyLinkedList<T>>)
46 explicit Deque_DoublyLinkedList (ITERABLE_OF_ADDABLE&& src)
47#if qCompilerAndStdLib_RequiresNotMatchInlineOutOfLineForTemplateClassBeingDefined_Buggy
49 {
50 this->AddAllToTail (forward<ITERABLE_OF_ADDABLE> (src));
51 AssertRepValidType_ ();
52 }
53#endif
54 ;
55 template <IInputIterator<T> ITERATOR_OF_ADDABLE>
56 Deque_DoublyLinkedList (ITERATOR_OF_ADDABLE&& start, ITERATOR_OF_ADDABLE&& end);
57
58 public:
59 nonvirtual Deque_DoublyLinkedList<T>& operator= (Deque_DoublyLinkedList&&) noexcept = default;
60 nonvirtual Deque_DoublyLinkedList<T>& operator= (const Deque_DoublyLinkedList&) = default;
61
62 private:
63 class Rep_;
64
65 private:
66 nonvirtual void AssertRepValidType_ () const;
67 };
68}
69
70/*
71 ********************************************************************************
72 ******************************* Implementation Details *************************
73 ********************************************************************************
74 */
75
76#include "Deque_DoublyLinkedList.inl"
77
78#endif /*_Stroika_Foundation_Containers_Concrete_Deque_DoublyLinkedList_h_ */
Deque_DoublyLinkedList<T> is an Array-based concrete implementation of the Deque<T> container pattern...
typename inherited::value_type value_type
Definition Deque.h:69
nonvirtual void AddAllToTail(ITERABLE_OF_ADDABLE &&s)
static constexpr default_sentinel_t end() noexcept
Support for ranged for, and STL syntax in general.