33 ranges_(initialCapacity)
45 ranges_(
std::move(list))
49 template<
int AnySizeMin>
55 ranges_(
std::move(list))
78 return (*list_)[index_][subIndex_];
87 if (++subIndex_ >= (*list_)[index_].size())
108 inline constexpr
bool 109 Foam::labelRanges::const_iterator::
117 index_ == iter.index_
118 && subIndex_ == iter.subIndex_
123 inline constexpr
bool 124 Foam::labelRanges::const_iterator::
130 return !(*
this == iter);
141 if (
range.size() > 0)
152 for (
const labelRange&
range : ranges_)
154 if (
range.contains(value))
164 template<
class... Args>
167 return ranges_.emplace_back(
args...);
210 if (i <= 0)
return this->
cbegin();
217 if (subIdx <
range.size())
219 return const_iterator(&ranges_, idx, subIdx);
224 if (
range.size() > 0)
226 subIdx -=
range.size();
labelRanges()=default
Default construct.
const_iterator begin() const noexcept
A const_iterator set to the beginning of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A range or interval of labels defined by a start and a size.
bool contains(const label value) const noexcept
True if the value is contained within any of the sub-ranges.
constexpr const_iterator(const UList< labelRange > *list, const label idx=0, const label subIdx=0) noexcept
Construct from range list at given index (and sub-index)
label operator*() const
Return the current label.
const const_iterator cend() const noexcept
A const_iterator set to beyond the end of the list.
const_iterator & operator++()
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
void sort()
Inplace sort of the range elements.
void sort(UList< T > &list)
Sort the list.
const const_iterator end() const noexcept
A const_iterator set to beyond the end of the list.
constexpr auto cend(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
labelRange & emplace_back(Args &&... args)
Construct a range element at the end of the list, return reference to the new element.
label totalSize() const noexcept
The linear size (sum of all the element sizes)
Foam::argList args(argc, argv)
const_iterator cbegin() const noexcept
A const_iterator set to the beginning of the list.
Forward input iterator with const access.