40 if (this->size_ == len)
49 const label oldLen = this->size_;
52 count = std::min(count, len);
68 std::move(old, (old + count), this->v_);
107 <<
"bad size " << len
127 <<
"bad size " << len
148 <<
"bad size " << len
175 this->v_[0] = std::move(val);
195 doAlloc(list.size());
196 UList<T>::deepCopy(list);
208 doAlloc(list.size());
209 UList<T>::deepCopy(list);
223 this->size_ = list.size_;
227 else if (!list.
empty())
229 doAlloc(list.size());
230 UList<T>::deepCopy(list);
240 if (!indices.
empty())
242 doAlloc(indices.size());
243 copyList(list, indices);
260 doAlloc(indices.size());
261 copyList(list, indices);
281 doAlloc(list.size());
295 doAlloc(list.size());
296 UList<T>::deepCopy(list);
333 const label oldLen = this->size_;
340 resize_copy(oldLen, len);
343 if (oldLen < this->size_)
347 (this->v_ + oldLen), (this->v_ + this->size_), val
363 this->size_ = list.size_;
380 transfer(
static_cast<List<T>&
>(list));
395 resize_nocopy(list.
size());
412 resize_nocopy(list.size());
425 resize_nocopy(list.size());
427 std::copy(list.begin(), list.end(), this->v_);
444 std::copy(list.begin(), list.end(), this->v_);
485 const UList<T>& list,
493template<
class T,
class ListComparePredicate>
496 const UList<T>& list,
498 const ListComparePredicate& comp
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void setCapacity_unsafe(label len) noexcept
Change the value for the list capacity directly (ADVANCED, UNSAFE) Does not perform any memory manage...
void shrink_to_fit()
Shrink the allocated space to the number of elements used.
A 1D vector of objects of type <T> with a fixed length <N>.
static constexpr label size() noexcept
Return the number of elements in the FixedList.
iterator end() noexcept
Return an iterator to end traversing the FixedList.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
label size() const noexcept
The number of elements in the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
void operator=(const UList< T > &list)
Assignment to UList operator. Takes linear time.
constexpr List() noexcept
Default construct.
void resize_copy(label count, const label len)
Change allocated size of list, retaining the first count elements.
void resize(const label len)
Adjust allocated size of list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
void deepCopy(const UList< T > &list)
Copy elements of the given UList. Sizes must match!
UList(const UList< T > &) noexcept=default
Copy construct, shallow copy.
bool empty() const noexcept
True if List is empty (ie, size() is zero).
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
UList< T > & operator=(const UList< T > &)=delete
No copy assignment (default: shallow copy).
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Additional compile-time controls of List behaviour.
T * allocate(IntType n)
Allocate from memory pool (if active), or aligned, or normal.
void deallocate(T *ptr)
Deallocate from memory pool, or normal.
List< label > labelList
A List of labels.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
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...
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
UList< label > labelUList
A UList of labels.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void stableSort(UList< T > &list)
Stable sort the list.
#define FOAM_LIKELY(cond)
#define FOAM_UNLIKELY(cond)
A list compare binary predicate for normal sort.