Eigenpoll : D wish list : Power operator
auto x = M(1,2) ** 4;
class M {
M opPow(int n) {
if (n == 1) return this;
else if (n % 2) return opPow(n/2)*this;
else return opPow(n/2)*opPow(n/2);
}
}
And speciall case when n is const (allow very agresive inlining).
Report this item for cleanup