diff options
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 9b52d739bf2..ea4f44df909 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -7507,6 +7507,13 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitClassDefStart(const ClassDefPtr& p) emitOneShotConstructor(p); H << sp; } + + if(p->hasMetaData("cpp:comparable")) + { + H << sp; + H << nl << "virtual bool operator==(const " << p->name() << "&) const = 0;"; + H << nl << "virtual bool operator<(const " << p->name() << "&) const = 0;"; + } return true; } |