39 if (len == this->size_)
54 this->v_ =
new T[len];
59 std::move(old, (old +
overlap), this->v_);
68 this->v_ =
new T[len];
92 UList<
T>(nullptr, len)
108 UList<
T>(nullptr, len)
113 <<
"bad size " << len
128 UList<
T>(nullptr, len)
133 <<
"bad size " << len
159 this->v_[0] = std::move(val);
175 UList<
T>(nullptr, list.size_)
188 UList<
T>(nullptr, list.size_)
201 UList<
T>(nullptr, list.size_)
223 UList<
T>(nullptr, indices.size())
226 copyList(list, indices);
238 UList<
T>(nullptr, indices.size())
241 copyList(list, indices);
256 UList<
T>(nullptr, list.size())
267 UList<
T>(nullptr, list.size())
295 template<
int SizeMin>
318 const label oldLen = this->size_;
322 if (oldLen < this->size_)
326 (this->v_ + oldLen), (this->v_ + this->size_), val
342 this->size_ = list.size_;
351 template<
int SizeMin>
359 transfer(
static_cast<List<T>&
>(list));
404 reAlloc(list.size());
406 std::copy(list.begin(), list.end(), this->v_);
414 reAlloc(list.
size());
422 reAlloc(list.size());
424 std::copy(list.begin(), list.end(), this->v_);
441 template<
int SizeMin>
465 const UList<T>& list,
473 template<
class T,
class ListComparePredicate>
476 const UList<T>& list,
478 const ListComparePredicate& comp
503 const label len = list.size();
512 for (
const T& val : list)
A 1D vector of objects of type <T> with a fixed length <N>.
void resize(const label len)
Adjust allocated size of list.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Template class for non-intrusive linked lists.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
void stableSort(UList< T > &list)
Stable sort the list.
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
void shrink_to_fit()
Shrink the allocated space to the number of elements used.
UList< label > labelUList
A UList of labels.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
void operator=(const UList< T > &list)
Assignment to UList operator. Takes linear time.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
const cellCellStencilObject & overlap
label size() const noexcept
The number of elements in the list.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
void clearStorage()
Clear the list and delete storage.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
List< label > labelList
A List of labels.
Non-intrusive singly-linked list.
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
constexpr List() noexcept
Default construct.
A list compare binary predicate for normal sort.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
static constexpr const zero Zero
Global zero (0)