Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Sequence_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_Sequence_DoublyLinkedList_h_
5#define _Stroika_Foundation_Containers_Concrete_Sequence_DoublyLinkedList_h_
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include "Stroika/Foundation/Containers/Sequence.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 Sequence_DoublyLinkedList<T> is an Array-based concrete implementation of the Sequence<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 * o Append () is O(N)
28 * o Prepend () is constant complexity
29 * o Indexing (GetAt/SetAt,operator[]) are O(N)
30 */
31 template <typename T>
33 private:
34 using inherited = Sequence<T>;
35
36 public:
37 using value_type = typename inherited::value_type;
38
39 public:
40 /**
41 * \see docs on Sequence<> constructor
42 */
45 Sequence_DoublyLinkedList (const Sequence_DoublyLinkedList&) noexcept = default;
46 Sequence_DoublyLinkedList (const initializer_list<value_type>& src);
47 template <IIterableOfTo<T> ITERABLE_OF_ADDABLE>
48 requires (not derived_from<remove_cvref_t<ITERABLE_OF_ADDABLE>, Sequence_DoublyLinkedList<T>>)
49 explicit Sequence_DoublyLinkedList (ITERABLE_OF_ADDABLE&& src)
50#if qCompilerAndStdLib_RequiresNotMatchInlineOutOfLineForTemplateClassBeingDefined_Buggy
52 {
53 this->AppendAll (forward<ITERABLE_OF_ADDABLE> (src));
54 AssertRepValidType_ ();
55 }
56#endif
57 ;
58 template <IInputIterator<T> ITERATOR_OF_ADDABLE>
59 Sequence_DoublyLinkedList (ITERATOR_OF_ADDABLE&& start, ITERATOR_OF_ADDABLE&& end);
60
61 public:
62 /**
63 */
64 nonvirtual Sequence_DoublyLinkedList& operator= (Sequence_DoublyLinkedList&&) noexcept = default;
65 nonvirtual Sequence_DoublyLinkedList& operator= (const Sequence_DoublyLinkedList&) = default;
66
67 private:
68 class Rep_;
69
70 private:
71 nonvirtual void AssertRepValidType_ () const;
72 };
73
74}
75
76/*
77 ********************************************************************************
78 ******************************* Implementation Details *************************
79 ********************************************************************************
80 */
81
82#include "Sequence_DoublyLinkedList.inl"
83
84#endif /*_Stroika_Foundation_Containers_Concrete_Sequence_DoublyLinkedList_h_ */
Sequence_DoublyLinkedList<T> is an Array-based concrete implementation of the Sequence<T> container p...
A generalization of a vector: a container whose elements are keyed by the natural numbers.
Definition Sequence.h:187
typename inherited::value_type value_type
Definition Sequence.h:198
nonvirtual void AppendAll(ITERABLE_OF_ADDABLE &&s)
static constexpr default_sentinel_t end() noexcept
Support for ranged for, and STL syntax in general.