17 #ifndef OPENKALMAN_MOST_FIXED_PATTERN_HPP 18 #define OPENKALMAN_MOST_FIXED_PATTERN_HPP 29 template<
typename D,
typename...Ds>
30 constexpr decltype(
auto)
31 impl(D&& d, Ds&&...ds)
33 if constexpr (
sizeof...(Ds) == 0)
return std::forward<D>(d);
34 else if constexpr (fixed_pattern<D>)
return std::forward<D>(d);
35 else return impl(std::forward<Ds>(ds)...);
40 template<
typename D,
typename...Ds>
41 constexpr decltype(
auto)
42 operator()(D&& d, Ds&&...ds)
44 static_assert((... and compares_with<D, Ds, &stdex::is_eq, applicability::permitted>),
45 "In most_fixed_pattern, elements of pattern_collection argument are not compatible");
46 return impl(std::forward<D>(d), std::forward<Ds>(ds)...);
57 template<pattern_collection P> requires values::fixed_value_compares_with<collections::size_of<P>, 0, &std::is_gt>
58 constexpr
pattern decltype(
auto)
60 template<
typename P, std::enable_if_t<values::fixed_value_compares_with<collections::size_of<P>, 0, &stdex::is_gt>,
int> = 0>
61 constexpr decltype(
auto)
Definition: get_descriptor_dimension.hpp:25
Definition for compares_with.
Definition: most_fixed_pattern.hpp:27
constexpr bool pattern
An object describing the set of coordinates associated with a tensor index.
Definition: pattern.hpp:31
decltype(auto) constexpr apply(F &&f, T &&t)
A generalization of std::apply.
Definition: apply.hpp:49
Inclusion file for collections.
decltype(auto) constexpr most_fixed_pattern(P &&p)
Given a fixed-size /ref coordinates::pattern_collection, return the first component, if any, that is a fixed_pattern.
Definition: most_fixed_pattern.hpp:63