37 this->v_ =
new T[this->size_];
45 if (this->size_ != len)
58 const label len = this->size_;
60 for (label i=0; i<len; ++i)
62 this->operator[](i) = list[i];
68 template<
class InputIterator>
71 InputIterator begIter,
72 InputIterator endIter,
76 UList<
T>(nullptr, len)
82 InputIterator iter = begIter;
83 for (label i = 0; i < len; ++i)
85 this->operator[](i) = *iter;
111 return NullObjectRef<List<T>>();
133 this->
resize(newLen,
false);
155 label
n = this->size();
177 const label idx = this->size();
180 this->operator[](idx) = val;
187 const label idx = this->size();
190 this->operator[](idx) = std::move(val);
203 label idx = this->size();
204 const label
n = list.
size();
208 for (label i=0; i<
n; ++i)
210 this->operator[](idx++) = list[i];
219 label idx = this->size();
220 const label
n = list.size();
224 for (label i=0; i<
n; ++i)
226 this->operator[](idx++) = list[i];
234 if (this->
found(val))
240 this->push_back(val);
249 if (
n >= this->size())
void size(const label n)
Older name for setAddressableSize.
void pop_back(label n=1)
Reduce size by 1 or more elements. Can be called on an empty list.
patchWriters resize(patchIds.size())
void resize(const label len)
Adjust allocated size of 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.
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 operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
static const List< T > & null()
Return a null List.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
void push_back(const T &val)
Append an element at the end of the list.
label push_uniq(const T &val)
Append an element if not already in the list.
void clear()
Clear the list, i.e. set size to zero.
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...
T & newElmt(const label i)
Return subscript-checked element of UList and resizing the list if required.
autoPtr< List< T > > clone() const
Clone.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
constexpr List() noexcept
Default construct.
static constexpr const zero Zero
Global zero (0)