summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDerek Bailey <derekbailey@google.com>2022-02-02 22:29:21 -0800
committerGitHub <noreply@github.com>2022-02-02 22:29:21 -0800
commitfd0d1ed9298d4f495492bfea7e58935d52489bd5 (patch)
treec28c8cfa02d64934f71e35659ce1157dcc4dc2cd /include
parent424988f308da2eb1ffb823080034706f056fda28 (diff)
downloadflatbuffers-fd0d1ed9298d4f495492bfea7e58935d52489bd5.tar.gz
flatbuffers-fd0d1ed9298d4f495492bfea7e58935d52489bd5.tar.bz2
flatbuffers-fd0d1ed9298d4f495492bfea7e58935d52489bd5.zip
update C++ generator to emit scoped enums in vector of unions (#7075)
Diffstat (limited to 'include')
-rw-r--r--include/flatbuffers/idl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h
index 039e3c5d..0b11ba45 100644
--- a/include/flatbuffers/idl.h
+++ b/include/flatbuffers/idl.h
@@ -468,6 +468,10 @@ inline bool IsUnion(const Type &type) {
return type.enum_def != nullptr && type.enum_def->is_union;
}
+inline bool IsUnionType(const Type &type) {
+ return IsUnion(type) && IsInteger(type.base_type);
+}
+
inline bool IsVector(const Type &type) {
return type.base_type == BASE_TYPE_VECTOR;
}