CortidQCT  1.2.2.52
Public Types | Public Member Functions | Public Attributes | List of all members
CortidQCT::DiscreteRange< T > Struct Template Reference

Type representing a discrete closed, stridable range. More...

#include <DiscreteRange.h>

Collaboration diagram for CortidQCT::DiscreteRange< T >:
Collaboration graph
[legend]

Public Types

using value_type = T
 type of the elements contained in the range
 

Public Member Functions

constexpr DiscreteRange (value_type min_, value_type max_, value_type stride_) noexcept
 Constructs a discrete range.
 
constexpr DiscreteRange (value_type min_, value_type max_) noexcept
 
constexpr std::size_t numElements () const noexcept
 Returns the number of elements in the range.
 
constexpr value_type nThElement (std::size_t n) const noexcept
 

Public Attributes

value_type min
 minimum element
 
value_type max
 maximum element
 
value_type stride
 stride, i.e. distance between two consecutive elements
 

Detailed Description

template<class T>
struct CortidQCT::DiscreteRange< T >

Type representing a discrete closed, stridable range.

Template Parameters
TUnderlying value type of the range

Constructor & Destructor Documentation

template<class T>
constexpr CortidQCT::DiscreteRange< T >::DiscreteRange ( value_type  min_,
value_type  max_ 
)
inlinenoexcept

Constructs a discreate range with an default stride of 1

Note
Only implemented for integral types

Member Function Documentation

template<class T>
constexpr value_type CortidQCT::DiscreteRange< T >::nThElement ( std::size_t  n) const
inlinenoexcept

Returns the n-th element

Parameters
nn-th element marker (starts at 1)
Returns
The n-th element

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