37 if (storage_.size() < len)
40 const label newCapacity =
41 max(min_size(),
max(len+1, label(2*storage_.size())));
43 if (nocopy || empty())
48 storage_.resize_nocopy(newCapacity);
53 const labelRange range1 = range_one();
54 const labelRange range2 = range_two();
56 List<T> old(newCapacity);
61 for (
const label i : range1)
63 storage_[end_++] = std::move(old[i]);
65 for (
const label i : range2)
67 storage_[end_++] = std::move(old[i]);
79 const label len = size_one();
80 return (len ? storage_.slice(begin_, len) :
SubList<T>());
87 const label len = size_two();
88 return (len ? storage_.slice(0, len) :
SubList<T>());
95 const label len = size_one();
96 return (len ? storage_.slice(begin_, len) :
SubList<T>());
103 const label len = size_two();
104 return (len ? storage_.slice(0, len) :
SubList<T>());
113 const auto list1 = this->array_one();
115 if (
pos < list1.size())
118 i = list1.find(val,
pos);
129 const auto list2 = this->array_two();
131 if (i < 0 && list2.size())
134 i = list2.find(val,
pos);
150 const label
n = this->size();
151 const label nBy2 =
n/2;
153 for (label i = 0; i < nBy2; ++i)
163 const auto list1 = array_one();
164 const auto list2 = array_two();
166 List<T> result(list1.size() + list2.size());
170 result.slice(0, list1.size()) = list1;
174 result.slice(list1.size(), list1.size() + list2.size()) = list2;
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar pos(const dimensionedScalar &ds)
List< T > list() const
Return a copy of the buffer flattened into a single List. Use sparingly!
A List obtained as a section of another List.
A simple list of objects of type <T> that is intended to be used as a circular buffer (eg...
SubList< T > array_one()
The contents of the first internal array.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
SubList< T > array_two()
The contents of the first internal array.
void reverse()
Reverse the buffer order, swapping elements.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.