summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-12-21 21:25:35 +0100
committerJose <jose@zeroc.com>2015-12-21 21:25:35 +0100
commite10648014880b39370c9abd9920ca8f61a93dfee (patch)
tree45fc795bce2470ec0131dbaad2660e8ccece80f7 /cpp/src/slice2cpp
parentAdd async metadata note to CHANGELOG-3.7.md (diff)
downloadice-e10648014880b39370c9abd9920ca8f61a93dfee.tar.bz2
ice-e10648014880b39370c9abd9920ca8f61a93dfee.tar.xz
ice-e10648014880b39370c9abd9920ca8f61a93dfee.zip
C++11 cpp:comparable for local classes
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp7
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;
}