mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-12 16:00:59 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user