Go to the documentation of this file.
36 this->v_ =
new T[this->size_];
44 if (this->size_ != len)
57 const label len = this->size_;
59 for (label i=0; i<len; ++i)
61 this->operator[](i) = list[i];
67 template<
class InputIterator>
70 InputIterator begIter,
71 InputIterator endIter,
75 UList<
T>(nullptr, len)
81 InputIterator iter = begIter;
82 for (label i = 0; i < len; ++i)
84 this->operator[](i) = *iter;
110 return NullObjectRef<List<T>>();
133 this->
resize(newSize,
false);
162 label
n = this->size();
184 resize(this->size() + 1, val);
191 const label idx = this->size();
194 this->operator[](idx) = std::move(val);
207 label idx = this->size();
208 const label
n = list.
size();
212 for (label i=0; i<
n; ++i)
214 this->operator[](idx++) = list[i];
223 label idx = this->size();
224 const label
n = list.
size();
228 for (label i=0; i<
n; ++i)
230 this->operator[](idx++) = list[i];
T & newElmt(const label i)
static const List< T > & null()
Return a null List.
static constexpr const zero Zero
Global zero (0)
void append(const T &val)
Append an element at the end of the list.
patchWriters resize(patchIds.size())
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
void resize(const label newSize)
Adjust allocated size of list.
errorManip< error > abort(error &err)
constexpr List() noexcept
Null constructor.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clear()
Clear the list, i.e. set size to zero.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
autoPtr< List< T > > clone() const
Clone.
void setSize(const label newSize)
Alias for resize(const label)
label size() const
The number of elements in the list.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...