Kiwaku 0.1-beta
Containers Well Made
 
Loading...
Searching...
No Matches
kwk::stride< Strides > Struct Template Reference

Fixed order stride with mixed size capability. More...

#include <kwk/utility/container/stride.hpp>

Detailed Description

template<auto... Strides>
struct kwk::stride< Strides >

Fixed order stride with mixed size capability.


Required header:

#include<kwk/utility/container/stride.hpp>

kwk::stride defines and optimally stores a set of integral values representing the strides used to walk through a given multi-dimensional container or view.

kwk::stride can be defined in two ways:

Template Parameters
StridesAn instance of a stride descriptor

Public Member Functions

constexpr stride ()
 Constructs a default kwk::stride equals to [1 1 ... 1].
 
constexpr stride (concepts::extent auto... values) noexcept
 Constructor from set of dimensions.
 
template<std::convertible_to< std::ptrdiff_t >... Is>
requires ( sizeof...(Is) == static_order )
constexpr auto linearize (Is... is) const noexcept
 Indexing interface.
 
template<auto... S2>
requires (sizeof...(S2) == static_order)
constexpr bool operator== (stride< S2... > const &other) const noexcept
 Equality comparison operator.
 

Static Public Member Functions

static constexpr auto order () noexcept
 Number of dimensions.
 

Static Public Attributes

static constexpr auto is_unit
 Checks a kwk::stride is unit - ie it's innermost value is statically known to be 1.
 
static constexpr std::int32_t static_order = parent::static_size
 Compile-time value for Order.
 

Friends

std::ostream & operator<< (std::ostream &os, stride const &s)
 Stream insertion operator.