stdex
Additional custom or not Standard C++ covered algorithms
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
stdex::interval< T > Struct Template Reference

Numerical interval. More...

#include <stdex/interval.hpp>

Public Member Functions

 interval () noexcept
 Constructs an invalid interval.
 
 interval (T x) noexcept
 Constructs a zero-size interval.
 
 interval (T _start, T _end) noexcept
 Constructs an interval.
 
size () const
 Returns interval size.
 
bool empty () const
 Is interval empty?
 
 operator bool () const
 Is interval valid?
 
bool operator== (const interval &other) const
 Are intervals identical?
 
bool operator!= (const interval &other) const
 Are intervals different?
 

Public Attributes

start
 interval start
 
end
 interval end
 

Detailed Description

template<class T>
struct stdex::interval< T >

Numerical interval.

Constructor & Destructor Documentation

◆ interval() [1/2]

template<class T >
stdex::interval< T >::interval ( x)
inlinenoexcept

Constructs a zero-size interval.

Parameters
[in]xInterval start and end value

◆ interval() [2/2]

template<class T >
stdex::interval< T >::interval ( _start,
_end 
)
inlinenoexcept

Constructs an interval.

Parameters
[in]_startInterval start value
[in]_endInterval end value

Member Function Documentation

◆ empty()

template<class T >
bool stdex::interval< T >::empty ( ) const
inline

Is interval empty?

Returns
true if interval is empty or false otherwise

◆ operator bool()

template<class T >
stdex::interval< T >::operator bool ( ) const
inline

Is interval valid?

Returns
true if interval is valid or false otherwise

◆ operator!=()

template<class T >
bool stdex::interval< T >::operator!= ( const interval< T > &  other) const
inline

Are intervals different?

Parameters
[in]otherOther interval to compare against
Returns
true if intervals are different or false otherwise

◆ operator==()

template<class T >
bool stdex::interval< T >::operator== ( const interval< T > &  other) const
inline

Are intervals identical?

Parameters
[in]otherOther interval to compare against
Returns
true if intervals are identical or false otherwise

◆ size()

template<class T >
T stdex::interval< T >::size ( ) const
inline

Returns interval size.

Returns
Interval size or 0 if interval is invalid

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