diff options
Diffstat (limited to 'cpp/src/slice2cppe/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cppe/Gen.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp index 627d1d12560..761f3dce990 100644 --- a/cpp/src/slice2cppe/Gen.cpp +++ b/cpp/src/slice2cppe/Gen.cpp @@ -769,15 +769,17 @@ void Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) { string name = fixKwd(p->name()); - TypePtr type = p->type(); - string s = typeToString(type); + StringList metaData = p->getMetaData(); string seqType = findMetaData(metaData); - if(!seqType.empty()) + if(!seqType.empty() && seqType != "array") { - return; + H << sp << nl << "typedef " << seqType << ' ' << name << ';'; + return; } - + + TypePtr type = p->type(); + string s = typeToString(type); H << sp << nl << "typedef ::std::vector<" << (s[0] == ':' ? " " : "") << s << "> " << name << ';'; BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); |