44 const label oldLen = this->size_;
56 this->v_ = ListPolicy::allocate<T>(len);
61 std::move(old, (old +
overlap), this->v_);
71 this->v_ = ListPolicy::allocate<T>(len);
95 UList<
T>(nullptr, len)
100 <<
"bad size " << len
114 UList<
T>(nullptr, len)
119 <<
"bad size " << len
134 UList<
T>(nullptr, len)
139 <<
"bad size " << len
165 this->v_[0] = std::move(val);
181 UList<
T>(nullptr, list.size_)
194 UList<
T>(nullptr, list.size_)
207 UList<
T>(nullptr, list.size_)
216 else if (this->size_ > 0)
227 UList<
T>(nullptr, indices.size())
230 copyList(list, indices);
242 UList<
T>(nullptr, indices.size())
245 copyList(list, indices);
253 List<
T>(list.begin(), list.
end(), list.size())
260 UList<
T>(nullptr, list.size())
271 UList<
T>(nullptr, list.size())
284 List<
T>(list.begin(), list.
end(), list.size())
299 template<
int SizeMin>
323 const label oldLen = this->size_;
330 this->resize_copy(oldLen, len);
333 if (oldLen < this->size_)
337 (this->v_ + oldLen), (this->v_ + this->size_), val
353 this->size_ = list.size_;
362 template<
int SizeMin>
370 transfer(
static_cast<List<T>&
>(list));
415 reAlloc(list.size());
417 std::copy(list.begin(), list.end(), this->v_);
425 reAlloc(list.
size());
433 reAlloc(list.size());
435 std::copy(list.begin(), list.end(), this->v_);
452 template<
int SizeMin>
476 const UList<T>& list,
484 template<
class T,
class ListComparePredicate>
487 const UList<T>& list,
489 const ListComparePredicate& comp
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...
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.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
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
#define FOAM_UNLIKELY(cond)
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...
#define FOAM_LIKELY(cond)
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.
void resize_copy(const label count, const label len)
Low-level resizing (backend for resize). Change allocation size of list, retaining the first count co...
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...