mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 04:58:57 +00:00
[C++] Use nullptr instead of 0 in generated headers (#6762)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user