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())
117 i = list1.find(val,
pos);
123 return this->array_two().find(val, 0);
133 const label
n = this->size();
134 const label nBy2 =
n/2;
136 for (label i = 0; i < nBy2; ++i)
A simple list of objects of type <T> that is intended to be used as a circular buffer (eg,...
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.
SubList< T > array_two()
The contents of the first internal array.
SubList< T > array_one()
The contents of the first internal array.
A List obtained as a section of another List.
dimensionedScalar pos(const dimensionedScalar &ds)
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)