Skip to content

Commit e5a9ff7

Browse files
authored
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
1 parent e53732b commit e5a9ff7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/flatbuffers/flatbuffers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,15 @@ inline const char* flatbuffers_version_string() {
260260
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ~ (E lhs){\
261261
return E(~T(lhs));\
262262
}\
263-
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator |= (E &lhs, E rhs){\
263+
inline FLATBUFFERS_CONSTEXPR_CPP14 E operator |= (E &lhs, E rhs){\
264264
lhs = lhs | rhs;\
265265
return lhs;\
266266
}\
267-
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator &= (E &lhs, E rhs){\
267+
inline FLATBUFFERS_CONSTEXPR_CPP14 E operator &= (E &lhs, E rhs){\
268268
lhs = lhs & rhs;\
269269
return lhs;\
270270
}\
271-
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ^= (E &lhs, E rhs){\
271+
inline FLATBUFFERS_CONSTEXPR_CPP14 E operator ^= (E &lhs, E rhs){\
272272
lhs = lhs ^ rhs;\
273273
return lhs;\
274274
}\

0 commit comments

Comments
 (0)