CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
Range Class Reference

Index range. More...

#include <cc/Range>

Public Member Functions

 Range ()
 Create an invalid range.
 
 Range (long i)
 Create an empty range starting and ending at i.
 
 Range (long i0, long i1)
 Create a range starting at i0 and ending at i1.
 
bool isValid () const
 Check if valid.
 
 operator bool () const
 Check if valid.
 
long i0 () const
 Begin of range.
 
long i1 () const
 End of range.
 
long begin () const
 Begin of range.
 
long end () const
 End of range.
 
long count () const
 Size of the range.
 
long operator[] (int k) const
 Syntax sugar.
 
long & operator[] (int k)
 Syntax sugar.
 
bool operator== (const Range &b) const
 Equal to operator.
 
bool operator!= (const Range &b) const
 Not equal to operator.
 
Range operator+ (long j) const
 Add j to the begin and end of this range and return the result.
 
Rangeoperator+= (long j)
 Add j to the begin and end of this range.
 

Detailed Description

Index range.

Constructor & Destructor Documentation

◆ Range() [1/3]

Range ( )

Create an invalid range.

◆ Range() [2/3]

Range ( long i)

Create an empty range starting and ending at i.

◆ Range() [3/3]

Range ( long i0,
long i1 )

Create a range starting at i0 and ending at i1.

Member Function Documentation

◆ isValid()

bool isValid ( ) const

Check if valid.

◆ operator bool()

operator bool ( ) const
explicit

Check if valid.

◆ i0()

long i0 ( ) const

Begin of range.

◆ i1()

long i1 ( ) const

End of range.

◆ begin()

long begin ( ) const

Begin of range.

◆ end()

long end ( ) const

End of range.

◆ count()

long count ( ) const

Size of the range.

◆ operator[]() [1/2]

long operator[] ( int k) const

Syntax sugar.

◆ operator[]() [2/2]

long & operator[] ( int k)

Syntax sugar.

◆ operator==()

bool operator== ( const Range & b) const

Equal to operator.

◆ operator!=()

bool operator!= ( const Range & b) const

Not equal to operator.

◆ operator+()

Range operator+ ( long j) const

Add j to the begin and end of this range and return the result.

◆ operator+=()

Range & operator+= ( long j)

Add j to the begin and end of this range.