Argon 0.1.0
Loading...
Searching...
No Matches
to_array.hpp File Reference

Helper functions to convert C-style arrays to std::array of Argon types, mimicking std::to_array. More...

#include <array>
#include "argon_for.hpp"
Include dependency graph for to_array.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T, std::size_t N, std::size_t... I>
constexpr std::array< helpers::ArgonFor_t< T >, N > argon::detail::to_array_impl (T(&a)[N], std::index_sequence< I... >)
template<class T, std::size_t N, std::size_t... I>
constexpr std::array< helpers::ArgonFor_t< T >, N > argon::detail::to_array_impl (T(&&a)[N], std::index_sequence< I... >)
template<class T, std::size_t N>
constexpr std::array< helpers::ArgonFor_t< T >, N > argon::to_array (T(&a)[N])
 Convert a C-style array of vector types to a std::array of Argon types.
template<class T, std::size_t N>
constexpr std::array< helpers::ArgonFor_t< T >, N > argon::to_array (T(&&a)[N])
 Convert a C-style array of vector types to a std::array of Argon types.

Detailed Description

Helper functions to convert C-style arrays to std::array of Argon types, mimicking std::to_array.

Function Documentation

◆ to_array() [1/2]

template<class T, std::size_t N>
std::array< helpers::ArgonFor_t< T >, N > argon::to_array ( T(&&) a[N])
constexpr

Convert a C-style array of vector types to a std::array of Argon types.

Template Parameters
TThe type of the elements in the array.
NThe number of elements in the array.
Parameters
aThe C-style array to convert.
Returns
A std::array of Argon types.

This overload is for rvalue references to arrays.

◆ to_array() [2/2]

template<class T, std::size_t N>
std::array< helpers::ArgonFor_t< T >, N > argon::to_array ( T(&) a[N])
constexpr

Convert a C-style array of vector types to a std::array of Argon types.

Template Parameters
TThe type of the elements in the array.
NThe number of elements in the array.
Parameters
aThe C-style array to convert.
Returns
A std::array of Argon types.