26 = decltype(std::declval<T>()
27 .power(std::declval<typename T::value_t>(), 0));
35 template <
typename WeightSet>
39 using typename super_t::value_t;
42 using super_t::super_t;
48 template <
typename... Ts>
53 using swallow =
int[];
64 template <
typename WS = super_t>
66 -> std::enable_if_t<detail::has_power_mem_fn<WS>{},
value_t>
68 return super_t::power(e, n);
73 template <
typename WS = super_t>
75 -> std::enable_if_t<!detail::has_power_mem_fn<WS>{},
value_t>
78 if (!super_t::is_one(e))
89 return power_<WeightSet>(e, n);
value_t mul(const Ts &...ts) const
A variadic multiplication.
auto power_(value_t e, unsigned n) const -> std::enable_if_t<!detail::has_power_mem_fn< WS >
Case where the weightset T does not feature a power(value_t, unsigned) member function.
constant< type_t::one, Context > one
auto power_(value_t e, unsigned n) const -> std::enable_if_t< detail::has_power_mem_fn< WS >
Case where the weightset T features a power(value_t, unsigned) member function.
value_t power(value_t e, unsigned n) const
Repeated multiplication.
variadic< type_t::mul, Context > mul
decltype(std::declval< T >().power(std::declval< typename T::value_t >(), 0)) power_mem_fn_t
The signature of power.
Provide a variadic mul on top of a binary mul(), and one().