[C++] Static assert on Flatbuffers Version (#7203)

* Static assert on Flatbuffers Version

* add comment
This commit is contained in:
Derek Bailey
2022-03-31 20:56:41 -07:00
committed by GitHub
parent 59e9713081
commit 0da6f94867
17 changed files with 137 additions and 0 deletions

View File

@@ -6,6 +6,13 @@
#include "flatbuffers/flatbuffers.h"
// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 2 &&
FLATBUFFERS_VERSION_MINOR == 0 &&
FLATBUFFERS_VERSION_REVISION == 6,
"Non-compatible flatbuffers version included");
namespace optional_scalars {
struct ScalarStuff;