33template<
class T,
unsigned N>
39 <<
"Invalid for non-contiguous data types"
48template<
class T,
unsigned N>
51 const auto iter = std::find(this->
cbegin(), this->
cend(), val);
52 return (iter != this->
cend() ? label(iter - this->
cbegin()) : label(-1));
56template<
class T,
unsigned N>
69 if (len > 0) len +=
pos;
70 if (len < 0 || len > label(
N))
75 const auto iter = std::find
77 (this->cbegin() + pos),
78 (this->cbegin() + len),
82 if (iter != (this->cbegin() + len))
84 return label(iter - this->cbegin());
92template<
class T,
unsigned N>
97 if (pos < 0 || pos >= label(
N))
104 if (this->v_[pos] == val)
116template<
class T,
unsigned N>
121 for (label lower = 0; lower < i; ++lower)
128template<
class T,
unsigned N>
133 for (label upper = label(
N-1); upper > i; --upper)
140template<
class T,
unsigned N>
152template<
class T,
unsigned N>
157 const label upper = label(
N-1);
168template<
class T,
unsigned N>
177 std::equal(this->
cbegin(), this->
cend(), list.cbegin())
182template<
class T,
unsigned N>
190 return std::lexicographical_compare
198template<
class T,
unsigned N>
205template<
class T,
unsigned N>
208 return list.operator<(*this);
212template<
class T,
unsigned N>
215 return !list.operator<(*this);
219template<
class T,
unsigned N>
A 1D vector of objects of type <T> with a fixed length <N>.
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant FixedList.
void moveLast(const label i)
Move element to the last position.
void swapLast(const label i)
Swap element with the last element.
bool operator>=(const FixedList< T, N > &list) const
Return true if !(a < b). Takes linear time.
static std::streamsize size_bytes() noexcept
Number of contiguous bytes for the list data,.
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant FixedList.
void checkIndex(const label i) const
Check index is within valid range [0,N).
void swapFirst(const label i)
Swap element with the first element.
bool operator<(const FixedList< T, N > &list) const
Compare two FixedLists lexicographically. Takes linear time.
label rfind(const T &val, label pos=-1) const
Find index of the last occurrence of the value.
static std::streamsize byteSize()
Number of contiguous bytes for the list data, runtime FatalError if type is not contiguous.
bool operator<=(const FixedList< T, N > &list) const
Return true if !(a > b). Takes linear time.
bool operator!=(const FixedList< T, N > &list) const
The opposite of the equality operation. Takes linear time.
void moveFirst(const label i)
Move element to the first position.
bool operator==(const FixedList< T, N > &list) const
Equality operation on FixedLists of the same type.
FixedList()=default
Default construct.
bool operator>(const FixedList< T, N > &list) const
Compare two FixedLists lexicographically. Takes linear time.
label find(const T &val) const
Find index of the first occurrence of the value.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar pos(const dimensionedScalar &ds)
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Exchange contents of lists - see DynamicList::swap().
errorManip< error > abort(error &err)
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr bool is_contiguous_v
The is_contiguous value of Type (after stripping of qualifiers).
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const Vector< label > N(dict.get< Vector< label > >("N"))