22 template <
typename WeightSet>
26 using typename super_t::value_t;
29 using super_t::super_t;
35 template <
typename... Ts>
40 using swallow =
int[];
43 ((res = super_t::mul(res, ts)), 0)...
51 using power_t = decltype(std::declval<T>()
52 .
power(std::declval<typename T::value_t>(), 0));
60 template <
typename WS = super_t>
62 -> std::enable_if_t<has_power_mem_fn<WS>{},
value_t>
64 return super_t::power(e, n);
69 template <
typename WS = super_t>
71 -> std::enable_if_t<!has_power_mem_fn<WS>{},
value_t>
74 if (!super_t::is_one(e))
85 return power_<WeightSet>(e, n);
value_t power(value_t e, unsigned n) const
Repeated multiplication.
auto power_(value_t e, unsigned n) const -> std::enable_if_t< has_power_mem_fn< WS >
Case where the weightset T features a power(value_t, unsigned) member function.
auto power_(value_t e, unsigned n) const -> std::enable_if_t<!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
decltype(std::declval< T >().power(std::declval< typename T::value_t >(), 0)) power_t
The signature of power.
value_t mul(const Ts &...ts) const
A variadic multiplication.