17 #ifndef OPENKALMAN_MAKE_FIXED_SQUARE_ADAPTER_LIKE_HPP 18 #define OPENKALMAN_MAKE_FIXED_SQUARE_ADAPTER_LIKE_HPP 28 template<
typename...Ts>
29 using best_desc = std::decay_t<decltype(best_vector_space_descriptor(std::declval<Ts>()...))>;
32 template<
typename...Ds,
typename Arg, std::size_t...Ix>
33 constexpr decltype(
auto) make_fixed_square_adapter_like_impl(Arg&& arg,
std::index_sequence<Ix...>)
35 using B = best_desc<Ds..., vector_space_descriptor_of_t<Arg, Ix>...>;
36 using F = decltype(make_fixed_size_adapter<std::conditional_t<Ix >= 0, B, B>...>(std::declval<Arg&&>()));
37 constexpr
bool better = (... or (dynamic_dimension<Arg, Ix> and not dynamic_dimension<F, Ix>));
38 if constexpr (better)
return F {std::forward<Arg>(arg)};
39 else return std::forward<Arg>(arg);
50 template<coordinates::pattern D = coordinates::Axis, coordinates::pattern...Ds, square_shaped<Applicability::permitted> Arg> requires
53 template<
typename...Ds,
typename Arg, std::enable_if_t<
54 (... and coordinates::pattern<Ds>) and square_shaped<Arg, Applicability::permitted> and
57 constexpr decltype(
auto)
58 make_fixed_square_adapter_like(Arg&& arg)
60 return detail::make_fixed_square_adapter_like_impl<Ds...>(std::forward<Arg>(arg), std::make_index_sequence<index_count_v<Arg>>{});
66 #endif //OPENKALMAN_MAKE_FIXED_SQUARE_ADAPTER_LIKE_HPP Definition for compares_with.
Definition of the Dimensions class.
Definition: tuple_reverse.hpp:103
Definition for coordinates::pattern.
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
constexpr std::size_t dynamic_size
A constant indicating that a size or index is dynamic.
Definition: global-definitions.hpp:33
Definition: basics.hpp:48