Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::range_slice< FirstType, LastType, StrideType > Class Template Reference

represents a slice of integer indices given the first and last More...

Public Types

using first_type = FirstType
 first index type
 
using last_type = LastType
 last index type
 
using stride_type = StrideType
 stride type
 

Public Attributes

first_type first {}
 start index First index (inclusive) in this slice.
 
last_type last {}
 last index Last index (exclusive) in this slice.
 
stride_type stride {}
 stride of indices Stride (or step) between indices in this slice.
 

Detailed Description

template<class FirstType, class LastType = FirstType, class StrideType = std::integral_constant<std::size_t, 1>>
class arene::base::range_slice< FirstType, LastType, StrideType >

represents a slice of integer indices given the first and last

Template Parameters
FirstTypetype used to specify the first index
LastTypetype used to specify the last index
StrideTypetype used to specify the stride

range_slice<int>{1, 11, 3} indicates the indices 1, 4, 7, and 10. Indices are selected from the half-open interval [1, 11) with a stride of 3.

Member Typedef Documentation

◆ first_type

template<class FirstType, class LastType = FirstType, class StrideType = std::integral_constant<std::size_t, 1>>
using arene::base::range_slice< FirstType, LastType, StrideType >::first_type = FirstType

first index type

◆ last_type

template<class FirstType, class LastType = FirstType, class StrideType = std::integral_constant<std::size_t, 1>>
using arene::base::range_slice< FirstType, LastType, StrideType >::last_type = LastType

last index type

◆ stride_type

template<class FirstType, class LastType = FirstType, class StrideType = std::integral_constant<std::size_t, 1>>
using arene::base::range_slice< FirstType, LastType, StrideType >::stride_type = StrideType

stride type

Member Data Documentation

◆ first

template<class FirstType, class LastType = FirstType, class StrideType = std::integral_constant<std::size_t, 1>>
first_type arene::base::range_slice< FirstType, LastType, StrideType >::first {}

start index First index (inclusive) in this slice.

Attention
This value must be non-negative to represent a valid slice.

◆ last

template<class FirstType, class LastType = FirstType, class StrideType = std::integral_constant<std::size_t, 1>>
last_type arene::base::range_slice< FirstType, LastType, StrideType >::last {}

last index Last index (exclusive) in this slice.

◆ stride

template<class FirstType, class LastType = FirstType, class StrideType = std::integral_constant<std::size_t, 1>>
stride_type arene::base::range_slice< FirstType, LastType, StrideType >::stride {}

stride of indices Stride (or step) between indices in this slice.

Attention
This value must be positive to represent a valid slice.

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