RAVENNAKIT
Loading...
Searching...
No Matches
rav::Range< T > Class Template Reference

Represents a range of values. More...

#include <range.hpp>

Public Member Functions

 Range ()=default
constexpr Range (T start, T end)
T start () const
T end () const
bool contains (const T &value) const
 Check if the value is within the range.

Detailed Description

template<class T>
class rav::Range< T >

Represents a range of values.

Both start and end are inclusive. Range must be valid (start <= end).

Template Parameters
TThe value type.

Definition at line 36 of file range.hpp.

Constructor & Destructor Documentation

◆ Range() [1/2]

template<class T>
rav::Range< T >::Range ( )
default

◆ Range() [2/2]

template<class T>
rav::Range< T >::Range ( T start,
T end )
inlineconstexpr

Definition at line 40 of file range.hpp.

Member Function Documentation

◆ contains()

template<class T>
bool rav::Range< T >::contains ( const T & value) const
inlinenodiscard

Check if the value is within the range.

Both start and end are inclusive.

Parameters
valueThe value to check.
Returns
True if the value is within the range, false otherwise.

Definition at line 63 of file range.hpp.

◆ end()

template<class T>
T rav::Range< T >::end ( ) const
inlinenodiscard
Returns
The end of the range.

Definition at line 54 of file range.hpp.

◆ start()

template<class T>
T rav::Range< T >::start ( ) const
inlinenodiscard
Returns
The start of the range.

Definition at line 47 of file range.hpp.


The documentation for this class was generated from the following file: