flatbuffers.h: fix C++11 compilation (#8857) (#8858)

This constexpr officially works only with C++14 (assignment to lhs, 2 statements) and actually broke some C++11 compilers
This commit is contained in:
Markus Junginger 2026-02-04 14:34:55 +01:00 committed by GitHub
parent e53732b9b9
commit e5a9ff757f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -260,15 +260,15 @@ inline const char* flatbuffers_version_string() {
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ~ (E lhs){\
return E(~T(lhs));\
}\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator |= (E &lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP14 E operator |= (E &lhs, E rhs){\
lhs = lhs | rhs;\
return lhs;\
}\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator &= (E &lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP14 E operator &= (E &lhs, E rhs){\
lhs = lhs & rhs;\
return lhs;\
}\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ^= (E &lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP14 E operator ^= (E &lhs, E rhs){\
lhs = lhs ^ rhs;\
return lhs;\
}\