blob: 0cd120f54405bb29f75aa0dbce915f8d79a7ace1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--- a/src/Mod/Sketcher/App/GeoEnum.h
+++ b/src/Mod/Sketcher/App/GeoEnum.h
@@ -114,6 +114,10 @@
*/
bool operator==(const GeoElementId& obj) const;
+ /** @brief less-than operator
+ */
+ bool operator<(const GeoElementId& obj) const;
+
/** @brief inequality operator
*/
bool operator!=(const GeoElementId& obj) const;
--- a/src/Mod/Sketcher/App/GeoEnum.cpp
+++ b/src/Mod/Sketcher/App/GeoEnum.cpp
@@ -32,6 +32,13 @@
return this->GeoId == obj.GeoId && this->Pos == obj.Pos;
}
+bool GeoElementId::operator<(const GeoElementId& obj) const
+{
+ return (this->GeoId != obj.GeoId)
+ ? (this->GeoId < obj.GeoId)
+ : (static_cast<int>(this->Pos) < static_cast<int>(obj.Pos));
+}
+
bool GeoElementId::operator!=(const GeoElementId& obj) const
{
return this->GeoId != obj.GeoId || this->Pos != obj.Pos;
|