Go to the documentation of this file.
53 return NullObjectRef<UList<T> >();
60 return (i == size()-1 ? 0 : i+1);
67 return (i ? i-1 : size()-1);
75 if (start<0 || (start && start>=size_))
78 <<
"start " << start <<
" out of range 0 ... " <<
max(size_-1, 0)
88 if (size<0 || size>size_)
91 <<
"size " << size <<
" out of range 0 ... " << size_
104 <<
"attempt to access element " << i <<
" from zero sized list"
107 else if (i<0 || i>=size_)
110 <<
"index " << i <<
" out of range 0 ... " << size_-1
119 return this->operator[](0);
126 return this->operator[](0);
133 return this->operator[](this->size()-1);
140 return this->operator[](this->size()-1);
208 return *
reinterpret_cast<const List<T>*
>(
this);
324 for (
int i=0; i<
n/2; i++)
326 Swap(ul[i], ul[
n-1-i]);
const_reverse_iterator crbegin() const
Return const_reverse_iterator to begin reverse traversing the UList.
const_iterator cbegin() const
Return const_iterator to begin traversing the constant UList.
T & operator[](const label)
Return element of UList.
const_iterator cend() const
Return const_iterator to end traversing the constant UList.
T & first()
Return the first element of the list.
label max_size() const
Return size of the largest possible UList.
static const label labelMax
T * data()
Return a pointer to the first data element,.
void checkSize(const label size) const
Check size is within valid range (0 ... size).
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
reverse_iterator rbegin()
Return reverse_iterator to begin reverse traversing the UList.
iterator begin()
Return an iterator to begin traversing the UList.
const_reverse_iterator crend() const
Return const_reverse_iterator to end reverse traversing the UList.
void checkStart(const label start) const
Check start is within valid range (0 ... size-1).
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
T * iterator
Random access iterator for traversing UList.
T & last()
Return the last element of the list.
reverse_iterator rend()
Return reverse_iterator to end reverse traversing the UList.
errorManip< error > abort(error &err)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
Traits class for primitives.
const T * cdata() const
Return a const pointer to the first data element,.
bool empty() const
Return true if the UList is empty (ie, size() is zero).
static const UList< T > & null()
Return a null UList.
iterator end()
Return an iterator to end traversing the UList.
label size() const
Return the number of elements in the UList.
void checkIndex(const label i) const
Check index i is within valid range (0 ... size-1).
void reverse(UList< T > &, const label n)