update C++ generator to emit scoped enums in vector of unions (#7075)

This commit is contained in:
Derek Bailey
2022-02-02 22:29:21 -08:00
committed by GitHub
parent 424988f308
commit fd0d1ed929
2 changed files with 7 additions and 2 deletions

View File

@@ -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;
}