acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
comparable_array.h
1#pragma once
2
3
4
5template < class TYPE, class ARG_TYPE, class ARRAY_TYPE >
7 public ARRAY_TYPE
8 //public comparable_range < ARRAY_TYPE >
9{
10public:
11
12
13 //using BASE_ARRAY = comparable_range < ARRAY_TYPE >;
14
15 using BASE_ARRAY = ARRAY_TYPE;
16 using RAW_BASE_ARRAY = typename BASE_ARRAY::RAW_BASE_ARRAY;
17
18 using BASE_RANGE = typename BASE_ARRAY::BASE_RANGE;
19
20 using BASE_RAW_RANGE = typename BASE_ARRAY::BASE_RAW_RANGE;
21
22 using CONST_RAW_RANGE = typename BASE_ARRAY::CONST_RAW_RANGE;
23
24 //using BASE_ARRAY::operator &=;
25 //using BASE_ARRAY::operator -=;
26 //using BASE_ARRAY::operator |=;
27 //using BASE_ARRAY::operator -;
28 //using BASE_ARRAY::operator ==;
29 //using BASE_ARRAY::operator !=;
30
31 //using comparable_range < ARRAY_TYPE >::comparable_range;
32
33 using BASE_ARRAY::BASE_ARRAY;
34 using BASE_ARRAY::operator =;
35 using BASE_ARRAY::operator +=;
36 using BASE_ARRAY::operator -=;
37
38 //comparable_array_base(const RAW_BASE_ARRAY& a) : BASE_ARRAY(a) { }
39 using iterator = typename BASE_ARRAY::iterator;
40 using const_iterator = typename BASE_ARRAY::const_iterator;
41
42 using this_iterator = typename BASE_ARRAY::this_iterator;
43 //using ARRAY_TYPE::ARRAY_TYPE;
44
45 // comparable_array_base() { }
46 // comparable_array_base(::std::initializer_list < TYPE > initializer_list) { this->add_initializer_list(initializer_list); }
47 // comparable_array_base(const comparable_array_base & array) : BASE_ARRAY(array) {}
48 // comparable_array_base(comparable_array_base && array) : BASE_ARRAY(::transfer(array)) {}
49 // template < prototype_integral INTEGRAL >
50 // comparable_array_base(const_iterator begin, INTEGRAL count) : BASE_ARRAY(begin, count) {}
51 // comparable_array_base(const_iterator begin, const_iterator end) : BASE_ARRAY(begin, end) {}
52 // comparable_array_base(const_iterator begin) : BASE_ARRAY(begin, find_first_null_character(begin)) {}
53
54
55 // using ARRAY_TYPE::operator =;
56 //
57 // comparable_array_base & operator = (const comparable_array_base & array)
58 // {
59 // BASE_ARRAY::operator = (array);
60 // return *this;
61 // }
62 // comparable_array_base & operator = (comparable_array_base && array)
63 // {
64 // BASE_ARRAY::operator = (::transfer(array));
65 // return *this;
66 // }
67 //
68
69
70 using BASE_RANGE::_order;
71
72 constexpr auto _order(const BASE_RAW_RANGE & range) const
73 {
74
75 return _order(range, ::comparison::comparison < TYPE >());
76
77 }
78
79
80 using BASE_RANGE::order;
81
82 constexpr auto order(const BASE_RAW_RANGE & range) const
83 {
84
85 return BASE_RANGE::order(range, ::comparison::comparison < TYPE >());
86
87 }
88
89
90
91
92 constexpr auto operator<=>(const comparable_array_base & array) const
93 {
94
95 return this->order(array);
96
97 }
98
99
100//
101// comparable_array_base & operator = (comparable_array_base && array)
102// {
103//
104// BASE_ARRAY::operator = (::transfer(array));
105//
106// return *this;
107//
108// }
109
110
111
112 // template < prototype_container CONTAINER >
113 // inline comparable_array_base & operator += (const CONTAINER & container)
114 // {
115 //
116 // if (&container == this)
117 // {
118 //
119 // auto aCopy(container);
120 //
121 // this->append_container(aCopy);
122 //
123 // }
124 // else
125 // {
126 //
127 // this->append_container(container);
128 //
129 // }
130 //
131 // return *this;
132 //
133 // }
134
135
136 // inline comparable_array_base & operator += (const TYPE & t)
137 // {
138 //
139 // this->add_item(t);
140 //
141 // return *this;
142 //
143 // }
144
145};
146
147
148
149//template < class TYPE,class ARG_TYPE,class ARRAY_TYPE >
150//full_comparable_array< TYPE,ARG_TYPE,ARRAY_TYPE >::
151//full_comparable_array()
152//{
153//}
154//template < class TYPE,class ARG_TYPE,class ARRAY_TYPE >
155//full_comparable_array< TYPE,ARG_TYPE,ARRAY_TYPE >::
156//full_comparable_array(const full_comparable_array< TYPE,ARG_TYPE,ARRAY_TYPE > & a):
157// ARRAY_TYPE(a)
158//{
159// this->operator = (a);
160//}
161//
162//
Definition comparable_array.h:9
Definition range.h:223