Removed unnecessary check for Offset in AssertScalarT()

This will avoid it accidentally accepting structs of size 4.

Change-Id: I251285ae1e4bffb859367dcf89562741a3980bba
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2017-05-10 18:00:27 -07:00
parent 9d01bfaea3
commit 349a391208

View File

@@ -820,10 +820,7 @@ FLATBUFFERS_FINAL_CLASS
template<typename T> void AssertScalarT() {
#ifndef FLATBUFFERS_CPP98_STL
// The code assumes power of 2 sizes and endian-swap-ability.
static_assert(std::is_scalar<T>::value
// The Offset<T> type is essentially a scalar but fails is_scalar.
|| sizeof(T) == sizeof(Offset<void>),
"T must be a scalar type");
static_assert(std::is_scalar<T>::value, "T must be a scalar type");
#endif
}