Open vladipus opened 1 year ago
I too encountered this issue. However, it seems intentional to me because this library aims to support C++11 which does not allow operator overloads to be constexpr. I did not look very closely into the code, but I think constexpr could be conditionally enabled for C++14 using version specific macros
Binary operators like:
template <typename B, typename I, unsigned int F, bool R> constexpr inline fixed<B, I, F, R> operator+(const fixed<B, I, F, R>& x, const fixed<B, I, F, R>& y) noexcept { return fixed<B, I, F, R>(x) += y; }
are defined as constexpr but the += operator is never constexpr which results in a "cannot result in a constant expression" error.