53 return NullObjectRef<UList<T>>();
60 return (i == size()-1 ? 0 : i+1);
67 return (i ? i-1 : size()-1);
74 if (start<0 || (start && start>=size_))
77 <<
"start " << start <<
" out of range 0 ... " <<
max(size_-1, 0)
86 if (size<0 || size>size_)
89 <<
"size " << size <<
" out of range 0 ... " << size_
101 <<
"attempt to access element from zero sized list" 104 else if (i<0 || i>=size_)
107 <<
"index " << i <<
" out of range 0 ... " << size_-1
116 return this->operator[](0);
123 return this->operator[](0);
130 return this->operator[](this->size()-1);
137 return this->operator[](this->size()-1);
208 return *
reinterpret_cast<const List<T>*
>(
this);
336 for (
int i=0; i<n/2; i++)
338 Swap(ul[i], ul[n-1-i]);
std::reverse_iterator< const_iterator > const_reverse_iterator
Reverse iterator for reverse traversal of constant UList.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
T & operator[](const label)
Return element of UList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const T * cdata() const
Return a const pointer to the first data element,.
const_reverse_iterator crbegin() const
Return const_reverse_iterator to begin reverse traversing the UList.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
const_iterator cbegin() const
Return const_iterator to begin traversing the constant UList.
Traits class for primitives.
T * iterator
Random access iterator for traversing UList.
iterator end()
Return an iterator to end traversing the UList.
T & first()
Return the first element of the list.
const_reverse_iterator crend() const
Return const_reverse_iterator to end reverse traversing the UList.
reverse_iterator rbegin()
Return reverse_iterator to begin reverse traversing the UList.
reverse_iterator rend()
Return reverse_iterator to end reverse traversing the UList.
iterator begin()
Return an iterator to begin traversing the UList.
static const label labelMax
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator for reverse traversal of UList.
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...
label max_size() const
Return size of the largest possible UList.
void reverse(UList< T > &, const label n)
static const UList< T > & null()
Return a null UList.
T * data()
Return a pointer to the first data element,.
void shallowCopy(const UList< T > &)
Copy the pointer held by the given UList.
const T * const_iterator
Random access iterator for traversing UList.
void checkSize(const label size) const
Check size is within valid range (0 ... size)
const_iterator cend() const
Return const_iterator to end traversing the constant UList.
T & last()
Return the last element of the list.
label size() const
Return the number of elements in the UList.
void checkStart(const label start) const
Check start is within valid range (0 ... size-1)
void checkIndex(const label i) const
Check index i is within valid range (0 ... size-1)