mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 20:31:23 +00:00
prevent name clash (#7133)
This commit is contained in:
@@ -1965,8 +1965,9 @@ class CppGenerator : public BaseGenerator {
|
||||
cw.IncrementIdentLevel();
|
||||
cw += "{{FIELD}}.reserve(o.{{FIELD}}.size());";
|
||||
cw +=
|
||||
"for (const auto &v : o.{{FIELD}}) { "
|
||||
"{{FIELD}}.emplace_back((v) ? new {{TYPE}}(*v) : nullptr); }";
|
||||
"for (const auto &{{FIELD}}_ : o.{{FIELD}}) { "
|
||||
"{{FIELD}}.emplace_back(({{FIELD}}_) ? new {{TYPE}}(*{{FIELD}}_) "
|
||||
": nullptr); }";
|
||||
vector_copies += cw.ToString();
|
||||
} else {
|
||||
// For non-pointer elements, use std::vector's copy constructor in the
|
||||
|
||||
Reference in New Issue
Block a user