Range

Range class

Represents a range with a start and end index. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

class Range : public System::Details::BoxableObjectBase

Methods

MethodDescription
static constexpr Range EndAt(const Index&)Creates a range that begins at the start of the collection and ends at the specified end index.
bool Equals(const Range&) constDetermines whether the current range is equal to the specified range.
static constexpr Range get_All()Returns a Range that represents the whole collection.
const Index& get_End() constGets the End index.
const Index& get_Start() constGets the Start index.
int32_t GetHashCode() constReturns a hash code for the current range.
System::ValueTuple<int32_t, int32_t> GetOffsetAndLength(int32_t) constComputes the zero-based start offset and length for the specified collection length.
constexpr Range()Constructs an empty range.
constexpr Range(const Index&, const Index&)Constructs a Range from the specified start and end indexes.
static constexpr Range StartAt(const Index&)Creates a range that begins at the specified start index and extends to the end of the collection.

See Also