29 #ifndef PIRANHA_INVERT_HPP 30 #define PIRANHA_INVERT_HPP 32 #include <type_traits> 34 #include <piranha/detail/sfinae_types.hpp> 35 #include <piranha/pow.hpp> 49 template <
typename T,
typename =
void>
94 template <
typename T1>
95 static auto test(
const T1 &x) -> decltype(
math::invert(x),
void(), yes());
100 static const bool value = std::is_same<decltype(test(std::declval<T>())), yes>::
value;
104 template <
typename T>
math_pow_t< T, U > pow(const T &x, const U &y)
Exponentiation.
auto invert(const T &x) -> decltype(invert_impl< T >()(x))
Compute the inverse.
auto operator()(const U &x) const -> decltype(math::pow(x, -1))
Call operator.
Type trait for invertible types.
static const bool value
Value of the type trait.
Default functor for the implementation of piranha::math::invert().