32inline void Foam::List<T>::doAlloc(
const label len)
37 this->v_ = ListPolicy::allocate<T>(len);
44template<
class ListType>
45inline void Foam::List<T>::copyList(
const ListType& list)
50 const label len = this->size_;
54 for (label i = 0; i < len; (void)++i, (void)++iter)
62template<
class ListType,
class ListIndices>
63inline void Foam::List<T>::copyList
66 const ListIndices& indices
72 const label len = this->size_;
76 for (label i = 0; i < len; (void)++i, (void)++iter)
78 *iter = list[indices[i]];
84template<
class InputIterator>
88 InputIterator inputEnd,
101 auto iter = this->v_;
102 const auto endIter = (iter + len);
104 for (; iter != endIter; (void)++iter, (void)++input)
162 if (this->size_ != len)
181 if (this->size_ != len)
192 label
n = this->size();
212template<
class... Args>
219 const label idx = this->size();
230 const label idx = this->size();
240 const label idx = this->size();
256 const label idx = this->
size();
271 const label idx = this->
size();
272 const label
n = list.
size();
275 auto iter = this->
begin(idx);
277 for (label i = 0; i <
n; (void)++i, (void)++iter)
287 if (this->contains(val))
302 if (
n >= this->
size())
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
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...
T & newElmt(const label i)
Return subscript-checked element of UList and resizing the list if required.
autoPtr< List< T > > clone() const
Clone.
void pop_back(label n=1)
Reduce size by 1 or more elements. Can be called on an empty 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.
T & emplace_back(Args &&... args)
Construct an element at the end of the list, return reference to the new list element.
constexpr List() noexcept
Default construct.
void resize_copy(label count, const label len)
Change allocated size of list, retaining the first count elements.
label push_uniq(const T &val)
Append an element if not already in the list.
void push_back(const T &val)
Append an element at the end of the list.
void resize(const label len)
Adjust allocated size of list.
void resize_fill(const label len, const T &val)
Adjust allocated size of list and set val for all elements.
void clear()
Clear the list, i.e. set size to zero.
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.
UList(const UList< T > &) noexcept=default
Copy construct, shallow copy.
bool contains(const T &val) const
True if the value is contained in the list.
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
T & operator[](const label i)
Return element of UList.
UList< T > & operator=(const UList< T > &)=delete
No copy assignment (default: shallow copy).
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
patchWriters resize(patchIds.size())
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void deallocate(T *ptr)
Deallocate from memory pool, or normal.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Foam::argList args(argc, argv)