44a45
> #include <stdexcept>
92a94
> #ifndef SWIG // SWIG gets confused by constexpr
93a96,97
> explicit constexpr Cycles(uint64_t _c) : c(_c) { }
> #else
94a99
> #endif
102c107
< operator uint64_t() const { return c; }
---
> constexpr operator uint64_t() const { return c; }
113c118
< const Cycles& operator+=(const Cycles& cc)
---
> Cycles& operator+=(const Cycles& cc)
117c122
< bool operator>(const Cycles& cc) const
---
> constexpr bool operator>(const Cycles& cc) const
120c125
< const Cycles operator +(const Cycles& b) const
---
> constexpr Cycles operator +(const Cycles& b) const
123,124c128,132
< const Cycles operator -(const Cycles& b) const
< { assert(c >= b.c); return Cycles(c - b.c); }
---
> constexpr Cycles operator -(const Cycles& b) const
> {
> return c >= b.c ? Cycles(c - b.c) :
> throw std::invalid_argument("RHS cycle value larger than LHS");
> }
126c134
< const Cycles operator <<(const int32_t shift)
---
> constexpr Cycles operator <<(const int32_t shift) const
129c137
< const Cycles operator >>(const int32_t shift)
---
> constexpr Cycles operator >>(const int32_t shift) const