11#include "webcface/common/webcface-config.h"
33 -> std::bool_constant<
34 std::is_convertible_v<decltype(*std::begin(std::declval<T>())),
36 std::is_convertible_v<decltype(*std::end(std::declval<T>())),
double>> {
43template <
typename T, std::
size_t Num>
45 -> std::bool_constant<std::tuple_size<T>::value == Num> {
48template <
typename T, std::
size_t Num>
50 std::declval<T>(), std::integral_constant<std::size_t, Num>()));
63template <
typename T, std::
size_t N>
66template <
typename T, std::
size_t N>
74template <
typename T, std::
size_t Num>
80template <
typename T, std::
size_t N, std::
size_t Num>
82template <
typename T, std::
size_t N, std::
size_t Num>
87 return std::vector<double>(std::begin(array), std::end(array));
90template <std::
size_t Num,
typename T>
92 std::array<double, Num> ret{};
94 auto it = std::begin(array);
95 for (; n < Num && it != std::end(array); ++it, ++n) {
98 if (n == Num && it == std::end(array)) {
101 throw std::invalid_argument(
102 "array size mismatch, expected: " + std::to_string(Num) +
103 ", got: " + std::to_string(n));
std::nullptr_t TraitOkType
Definition trait.h:11
constexpr std::false_type isArrayLike(...)
Definition array_like.h:30
decltype(isArrayLike(std::declval< T >())) IsArrayLike
Definition array_like.h:40
decltype(arraySizeMatch(std::declval< T >(), std::integral_constant< std::size_t, Num >())) ArraySizeMatch
Definition array_like.h:50
std::vector< double > arrayLikeToVector(const T &array)
Definition array_like.h:86
std::array< double, Num > arrayLikeToArray(const T &array)
Definition array_like.h:91
constexpr std::true_type arraySizeMatch(...)
Definition array_like.h:42
TraitOkType ArrayLike
Definition array_like.h:21
Definition array_like.h:18
Definition array_like.h:58
TraitOkType SizeMatchOrDynamic
Definition array_like.h:27
Definition array_like.h:24
Definition array_like.h:75
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103