6#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_ARRAY_TO_ARRAY_HPP_
7#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_ARRAY_TO_ARRAY_HPP_
18#include "arene/base/stdlib_choice/conditional.hpp"
19#include "arene/base/stdlib_choice/cstddef.hpp"
20#include "arene/base/stdlib_choice/enable_if.hpp"
21#include "arene/base/stdlib_choice/integer_sequence.hpp"
22#include "arene/base/stdlib_choice/is_array.hpp"
23#include "arene/base/stdlib_choice/is_constructible.hpp"
24#include "arene/base/stdlib_choice/is_move_constructible.hpp"
25#include "arene/base/stdlib_choice/is_object.hpp"
26#include "arene/base/stdlib_choice/is_void.hpp"
27#include "arene/base/stdlib_choice/move.hpp"
28#include "arene/base/stdlib_choice/remove_cv.hpp"
29#include "arene/base/stdlib_choice/remove_reference.hpp"
37namespace to_array_detail {
50 using convert_fn = std::conditional_t<std::is_void<D>::value, identity,
decltype(construct<D>)>;
54 template <
typename From>
70 template <
typename From,
std::size_t... Is,
typename Iterator>
72 noexcept(array<to_t<From>,
sizeof...(Is)>{{convert_fn{}(
static_cast<From
>(arr[Is]))...}})
73 ) -> array<to_t<From>,
sizeof...(Is)> {
75 return array<to_t<From>,
sizeof...(Is)>{{convert_fn{}(
static_cast<From
>(arr[Is]))...}};
89 std::enable_if_t<!std::is_array<T>::value>,
92 constexpr auto operator()(T (&arr)[Size])
const noexcept(
94 ) -> array<to_t<T&>, Size> {
104 std::enable_if_t<!std::is_array<T>::value>,
107 constexpr auto operator()(T (&&arr)[Size])
const noexcept(
109 ) -> array<to_t<T&&>, Size> {
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
static constexpr value_type value
Definition integral_constant.hpp:34
Definition accumulate.hpp:37
constexpr auto to_array_of
construct an array with a desired element type from a C-array.
Definition to_array.hpp:134
typename invoke_result< Fn, Args... >::type invoke_result_t
The return type of a functor invoked with the specified arguments.
Definition is_invocable.hpp:271
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
remove_cv_t< remove_reference_t< T > > remove_cvref_t
Backport of std::remove_cvref_t.
Definition remove_cvref.hpp:35
Definition accumulate.hpp:36
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
make_integer_sequence< size_t, Size > make_index_sequence
A helper alias template for make_integer_sequence<size_t, Size>
Definition integer_sequence.hpp:224
integer_sequence< size_t, Ints... > index_sequence
A helper alias template for integer_sequence<size_t, Ints>
Definition integer_sequence.hpp:218
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41