summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sheby <matthew.sheby@eikongroup.co.uk>2019-08-19 23:15:42 -0700
committerMatthew Sheby <matthew.sheby@eikongroup.co.uk>2019-08-19 23:15:42 -0700
commit75ca93c530e1f2531c66f7027213ec7514918508 (patch)
treeaa8c46d20236a48d0be6f9e2eeb2bb91d0f77173 /src
parentcf81f87c1517aabb892f0ea29ab5b6f7d8a09d47 (diff)
added greater-than operator to Kumu::Identifier
Diffstat (limited to 'src')
-rwxr-xr-xsrc/KM_util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/KM_util.h b/src/KM_util.h
index e8004c1..f3f60f1 100755
--- a/src/KM_util.h
+++ b/src/KM_util.h
@@ -303,6 +303,18 @@ namespace Kumu
return false;
}
+ inline bool operator>(const Identifier& rhs) const {
+ ui32_t test_size = xmin(rhs.Size(), SIZE);
+
+ for ( ui32_t i = 0; i < test_size; i++ )
+ {
+ if ( m_Value[i] != rhs.m_Value[i] )
+ return m_Value[i] > rhs.m_Value[i];
+ }
+
+ return false;
+ }
+
inline bool operator==(const Identifier& rhs) const {
if ( rhs.Size() != SIZE ) return false;
return ( memcmp(m_Value, rhs.m_Value, SIZE) == 0 );