summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CPlusPlusUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index dd282d5b68e..4ae02b9372f 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -1519,7 +1519,15 @@ Slice::writeStreamHelpers(Output& out,
out << nl << "template<typename S>";
out << nl << "struct StreamWriter" << (cpp11 ? "<" : "< ") << fullName << ", S>";
out << sb;
- out << nl << "static void write(S* __os, const " << fullName << "& v)";
+ if(requiredMembers.empty() && optionalMembers.empty())
+ {
+ out << nl << "static void write(S*, const " << fullName << "&)";
+ }
+ else
+ {
+ out << nl << "static void write(S* __os, const " << fullName << "& v)";
+ }
+
out << sb;
if(cpp11)
@@ -1550,7 +1558,15 @@ Slice::writeStreamHelpers(Output& out,
out << nl << "template<typename S>";
out << nl << "struct StreamReader" << (cpp11 ? "<" : "< ") << fullName << ", S>";
out << sb;
- out << nl << "static void read(S* __is, " << fullName << "& v)";
+ if (requiredMembers.empty() && optionalMembers.empty())
+ {
+ out << nl << "static void read(S*, " << fullName << "&)";
+ }
+ else
+ {
+ out << nl << "static void read(S* __is, " << fullName << "& v)";
+ }
+
out << sb;
if(cpp11)