17 #ifndef OPENKALMAN_VALUES_OPERATION_HPP 18 #define OPENKALMAN_VALUES_OPERATION_HPP 33 template<
typename Operation,
fixed...Args> requires
34 std::bool_constant<(stdex::invoke(Operation{}, fixed_value_of_v<Args>...),
true)>::
value 36 template<typename Operation, typename...Args>
42 static constexpr
auto value = stdex::invoke(Operation{}, fixed_value_of_v<Args>...);
43 using value_type = std::decay_t<decltype(value)>;
45 constexpr
operator value_type()
const {
return value; }
46 constexpr value_type operator()()
const {
return value; }
53 template<
typename Operation,
typename...Args>
60 template<
typename Op,
typename...Args>
62 template<
typename Op,
typename = void,
typename...Args>
68 template<
typename Op,
typename...Args> requires requires {
consteval_operation {std::declval<Op>(), std::declval<Args>()...}; }
71 template<typename Op, typename...Args>
77 template<
typename Op,
typename...Args>
93 template<
typename Operation,
typename...Args> requires std::invocable<Operation&&, value_type_of_t<Args&&>...>
95 template<
typename Operation,
typename...Args>
100 if constexpr ((... and fixed<Args>) and detail::operation_consteval_invocable<Operation, Args...>)
106 return stdex::invoke(std::forward<Operation>(op),
to_value_type(std::forward<Args>(args))...);
114 template<
typename Operation,
typename...Args>
Definition for values::to_value_type.
decltype(auto) constexpr to_value_type(Arg &&arg)
Convert, if necessary, a fixed or dynamic value to its underlying base type.
Definition: to_value_type.hpp:28
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
Definition: operation.hpp:64
Definition for value:value_type_of and value:value_type_of_t.
Definition for values::abs.
Definition: fixed-constants.hpp:23
decltype(operation(std::declval< Operation && >(), std::declval< Args && >()...)) operation_t
The resulting type from an values::operation.
Definition: operation.hpp:115
Definition for values::fixed_value_of.
consteval_operation(const Operation &, const Args &...) -> consteval_operation< Operation, Args... >
Deduction guide.
constexpr bool fixed
T is a value that is determinable at compile time.
Definition: fixed.hpp:66
Basic definitions for OpenKalman as a whole.
An operation involving some number of values.
Definition: operation.hpp:38
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98