rational: express assignment in terms of constructors

This commit is contained in:
Danny Robson 2016-05-12 17:55:20 +10:00
parent 48e6446404
commit 78552cfcb2

View File

@ -24,9 +24,9 @@ namespace util {
struct rational {
static_assert (std::is_integral<T>::value, "only defined for integer types");
rational (const rational&) = default;
rational (T n, T d);
explicit rational (T);
rational& operator= (const rational&) = default;
bool operator== (rational) const;
bool operator!= (rational) const;