how to use pow with a non numerical Monoid.
how to use pow with a non numerical Monoid.
#include <cassert>
#include <string>
namespace power_helper {
template <>
struct Monoid<
std::string> {
static std::string
one() {
return {}; };
static std::string
prod(std::string a, std::string b) {
return a + b; }
};
}
}
}
int main()
Definition CF.cpp:75
const T pow(const T x)
A generic compile time exponentiation function.
Definition power.hpp:91
Definition bmat16_impl.hpp:362
Generic compile-time unrolling of the fast exponentiation algorithm.
static const T prod(T a, T b)
the product of two elements of type T
Definition power.hpp:120
static const T one()
The one of type T.
Definition power.hpp:113