4#ifndef _Stroika_Foundation_Traversal_DisjointRange_h_
5#define _Stroika_Foundation_Traversal_DisjointRange_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
10#include "Stroika/Foundation/Common/Common.h"
11#include "Stroika/Foundation/Containers/Sequence.h"
37namespace Stroika::Foundation::Traversal {
47 template <
typename T,
typename RANGE_TYPE = Range<T>>
70 template <
typename CONTAINER_OF_RANGE_OF_T>
72 template <
typename COPY_FROM_ITERATOR_OF_RANGE_OF_T, sentinel_for<remove_cvref_t<COPY_FROM_ITERATOR_OF_RANGE_OF_T>> COPY_FROM_ITERATOR_OF_RANGE_OF_T2>
73 explicit DisjointRange (COPY_FROM_ITERATOR_OF_RANGE_OF_T&& start, COPY_FROM_ITERATOR_OF_RANGE_OF_T2&& end);
94 nonvirtual
bool empty ()
const;
100 nonvirtual
void clear ();
140 nonvirtual
bool Intersects (
const RangeType& rhs)
const;
167 nonvirtual
void MergeIn_ (
const RangeType& r);
170 nonvirtual
void AssertInternalRepValid_ ()
const;
176 static constexpr bool sNoisyDebugTrace_ =
false;
181 template <
typename T,
typename RANGE_TYPE>
182 DisjointRange<T, RANGE_TYPE> operator+ (
const DisjointRange<T, RANGE_TYPE>& lhs,
const DisjointRange<T, RANGE_TYPE>& rhs);
186 template <
typename T,
typename RANGE_TYPE>
187 DisjointRange<T, RANGE_TYPE> operator^ (
const DisjointRange<T, RANGE_TYPE>& lhs,
const DisjointRange<T, RANGE_TYPE>& rhs);
196#include "DisjointRange.inl"
String is like std::u32string, except it is much easier to use, often much more space efficient,...
A generalization of a vector: a container whose elements are keyed by the natural numbers.
A DisjointRange is NOT a range, but a collection of non-overlapping (except at the edges) Ranges....
typename RangeType::value_type value_type
Range::value_type is the type of the contained elements of the range (say range of integers,...
nonvirtual RangeType Closure() const
like GetBounds (), but always returns a closed range
nonvirtual bool empty() const
constexpr bool operator==(const DisjointRange &rhs) const
nonvirtual Containers::Sequence< RangeType > SubRanges() const
nonvirtual bool Contains(value_type elt) const
nonvirtual RangeType GetBounds() const
RANGE_TYPE RangeType
a Disjoint range collection of (disjoint) ranges of this type.
String ToString(T &&t, ARGS... args)
Return a debug-friendly, display version of the argument: not guaranteed parsable or usable except fo...