[C++] Use nullptr instead of 0 in generated headers (#6762)

This commit is contained in:
mogemimi
2021-08-03 05:41:15 +09:00
committed by GitHub
parent 775c6567d1
commit c39fc9dd9c
8 changed files with 14 additions and 12 deletions

View File

@@ -1683,6 +1683,8 @@ class CppGenerator : public BaseGenerator {
} else {
return "0";
}
} else if (IsStruct(type) && (field.value.constant == "0")) {
return "nullptr";
} else {
return GenDefaultConstant(field);
}