Sum

The sum of two compile-time rational numbers.

@safe
template Sum (
Lhs
Rhs
) if (
isRational!Lhs &&
isRational!Rhs
) {}

Examples

static assert(is(Sum!(Rational!(1, 3u), Rational!(1, 6u)) == Rational!(1, 2u)));
static assert(is(Sum!(Rational!2, Rational!1) == Rational!3));

Meta