diff --git a/include/fmt/format.h b/include/fmt/format.h index 1fc57de1..baebcff0 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -272,6 +272,12 @@ FMT_END_NAMESPACE # define FMT_DEPRECATED_NUMERIC_ALIGN 0 #endif +#ifdef __cpp_ref_qualifiers + # define FMT_METHOD_REF_QUALIFIER & +#else + # define FMT_METHOD_REF_QUALIFIER +#endif + FMT_BEGIN_NAMESPACE namespace detail { @@ -828,7 +834,7 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { uint64_t high() const FMT_NOEXCEPT { return uint64_t(internal_ >> 64); } uint64_t low() const FMT_NOEXCEPT { return uint64_t(internal_); } - uint128_wrapper& operator+=(uint64_t n) & FMT_NOEXCEPT { + uint128_wrapper& operator+=(uint64_t n) FMT_METHOD_REF_QUALIFIER FMT_NOEXCEPT { internal_ += n; return *this; } @@ -842,7 +848,7 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { uint64_t high() const FMT_NOEXCEPT { return high_; } uint64_t low() const FMT_NOEXCEPT { return low_; } - uint128_wrapper& operator+=(uint64_t n) & FMT_NOEXCEPT { + uint128_wrapper& operator+=(uint64_t n) FMT_METHOD_REF_QUALIFIER FMT_NOEXCEPT { # if defined(_MSC_VER) && defined(_M_X64) unsigned char carry = _addcarry_u64(0, low_, n, &low_); _addcarry_u64(carry, high_, 0, &high_);