0.2.0
Loading...
Searching...
No Matches
Array.hpp File Reference

Array Utility functions. More...

Go to the source code of this file.

Functions

template<std::size_t N, typename T >
constexpr std::array< T, N > NAV::create_array (const T &value)
 Create an array with the value assigned to all elements in the container.
 
template<typename T , std::size_t... Is>
constexpr std::array< T, sizeof...(Is)> NAV::detail::create_array (const T &value, std::index_sequence< Is... >)
 Create an array with the value assigned to all elements in the container.
 
template<size_t N, typename Scalar >
constexpr std::array< Scalar, N > NAV::genRangeArray (Scalar start, Scalar stepSize, Scalar end)
 Returns a container filled with the given range.
 

Detailed Description

Array Utility functions.

Author
T. Topp (topp@.nosp@m.ins..nosp@m.uni-s.nosp@m.tutt.nosp@m.gart..nosp@m.de)
Date
2024-01-15

Function Documentation

◆ create_array() [1/2]

template<std::size_t N, typename T >
constexpr std::array< T, N > NAV::create_array ( const T & value)
constexpr

Create an array with the value assigned to all elements in the container.

Parameters
[in]valueValue to fill with
Note
See https://stackoverflow.com/a/57757301

◆ create_array() [2/2]

template<typename T , std::size_t... Is>
constexpr std::array< T, sizeof...(Is)> NAV::detail::create_array ( const T & value,
std::index_sequence< Is... >  )
constexpr

Create an array with the value assigned to all elements in the container.

Parameters
[in]valueValue to fill with

◆ genRangeArray()

template<size_t N, typename Scalar >
constexpr std::array< Scalar, N > NAV::genRangeArray ( Scalar start,
Scalar stepSize,
Scalar end )
constexpr

Returns a container filled with the given range.

Parameters
startInclusive start value of the range
stepSizeStep size of the range
endExclusive end value of the range