OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::integer_range< T > Class Template Reference

Integer range type template usable in range-based loops. More...

#include <eagine/integer_range.hpp>

Public Types

using iterator = selfref_iterator< T >
 Iterator type alias.
 
using size_type = decltype(std::declval< T >() - std::declval< T >())
 Iteration count type alias.
 

Public Member Functions

constexpr integer_range () noexcept=default
 Default constructor. More...
 
constexpr integer_range (T e) noexcept
 Initialization specifying the past the end integer value. More...
 
constexpr integer_range (T b, T e) noexcept
 Initialization specifying the begin and past the end integer values. More...
 
constexpr auto empty () const noexcept
 Indicates that the range is empty. More...
 
constexpr auto size () const noexcept
 Returns the number of iteration steps in this range. More...
 
constexpr auto begin () const noexcept -> iterator
 Returns the iterator to the start of the range.
 
constexpr auto end () const noexcept -> iterator
 Returns the iterator past the end of the range.
 

Detailed Description

template<typename T>
class eagine::integer_range< T >

Integer range type template usable in range-based loops.

Instances of this class can be used as the range in range-based for loops instead of using, comparing and incrementing a for loop variable.

Constructor & Destructor Documentation

◆ integer_range() [1/3]

template<typename T >
constexpr eagine::integer_range< T >::integer_range ( )
constexprdefaultnoexcept

Default constructor.

Postcondition
empty()
begin() == end()

◆ integer_range() [2/3]

template<typename T >
constexpr eagine::integer_range< T >::integer_range ( e)
inlineconstexprnoexcept

Initialization specifying the past the end integer value.

Postcondition
size() == e

◆ integer_range() [3/3]

template<typename T >
constexpr eagine::integer_range< T >::integer_range ( b,
e 
)
inlineconstexprnoexcept

Initialization specifying the begin and past the end integer values.

Postcondition
size() == e - b

Member Function Documentation

◆ empty()

template<typename T >
constexpr auto eagine::integer_range< T >::empty ( ) const
inlineconstexprnoexcept

Indicates that the range is empty.

See also
size

◆ size()

template<typename T >
constexpr auto eagine::integer_range< T >::size ( ) const
inlineconstexprnoexcept

Returns the number of iteration steps in this range.

See also
empty

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

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).