Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
Collection_LinkedList.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_Collection_LinkedList_h_
5#define _Stroika_Foundation_Containers_Concrete_Collection_LinkedList_h_
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include "Stroika/Foundation/Containers/Collection.h"
10
11/**
12 * \file
13 *
14 * \note Code-Status: <a href="Code-Status.md#Beta">Beta</a>
15 */
16
18
19 /**
20 * \brief Collection_LinkedList<T> is an LinkedList-based concrete implementation of the Collection<T> container pattern.
21 *
22 * \note Runtime performance/complexity:
23 * o size () is O(N), but empty () is constant
24 *
25 * \note \em Thread-Safety <a href="Thread-Safety.md#C++-Standard-Thread-Safety">C++-Standard-Thread-Safety</a>
26 */
27 template <typename T>
29 private:
31
32 public:
33 using value_type = typename inherited::value_type;
34
35 public:
36 /**
37 * \see docs on Collection<T> constructor
38 */
40 Collection_LinkedList (Collection_LinkedList&&) noexcept = default;
41 Collection_LinkedList (const Collection_LinkedList&) noexcept = default;
42 Collection_LinkedList (const initializer_list<value_type>& src);
43 template <IIterableOfTo<T> ITERABLE_OF_ADDABLE>
44 requires (not derived_from<remove_cvref_t<ITERABLE_OF_ADDABLE>, Collection_LinkedList<T>>)
45 Collection_LinkedList (ITERABLE_OF_ADDABLE&& src)
46#if qCompilerAndStdLib_RequiresNotMatchInlineOutOfLineForTemplateClassBeingDefined_Buggy
48 {
49 this->AddAll (forward<ITERABLE_OF_ADDABLE> (src));
50 AssertRepValidType_ ();
51 }
52#endif
53 ;
54 template <IInputIterator<T> ITERATOR_OF_ADDABLE>
55 Collection_LinkedList (ITERATOR_OF_ADDABLE&& start, ITERATOR_OF_ADDABLE&& end);
56
57 public:
58 nonvirtual Collection_LinkedList& operator= (Collection_LinkedList&&) noexcept = default;
59 nonvirtual Collection_LinkedList& operator= (const Collection_LinkedList&) = default;
60
61 private:
62 using IImplRep_ = typename Collection<T>::_IRep;
63 class Rep_;
64
65 private:
66 nonvirtual void AssertRepValidType_ () const;
67 };
68
69}
70
71/*
72 ********************************************************************************
73 ******************************* Implementation Details *************************
74 ********************************************************************************
75 */
76#include "Collection_LinkedList.inl"
77
78#endif /*_Stroika_Foundation_Containers_Concrete_Collection_LinkedList_h_ */
A Collection<T> is a container to manage an un-ordered collection of items, without equality defined ...
nonvirtual void AddAll(ITERATOR_OF_ADDABLE &&start, ITERATOR_OF_ADDABLE2 &&end)
Collection_LinkedList<T> is an LinkedList-based concrete implementation of the Collection<T> containe...
static constexpr default_sentinel_t end() noexcept
Support for ranged for, and STL syntax in general.