From 358b91a901fa0a029f8757d6bd49c84ec9927bba Mon Sep 17 00:00:00 2001 From: Matt Kuruc Date: Mon, 26 Jun 2023 15:52:24 -0700 Subject: [PATCH] Replace `boost::totally_ordered` with explicit operator overloads for `SdfMapEditProxy` --- pxr/usd/sdf/mapEditProxy.h | 49 +++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/pxr/usd/sdf/mapEditProxy.h b/pxr/usd/sdf/mapEditProxy.h index ddc98ae4a7..433f566776 100644 --- a/pxr/usd/sdf/mapEditProxy.h +++ b/pxr/usd/sdf/mapEditProxy.h @@ -38,7 +38,6 @@ #include "pxr/base/tf/mallocTag.h" #include #include -#include #include #include @@ -117,8 +116,7 @@ class SdfIdentityMapEditProxyValuePolicy { /// \sa SdfIdentityMapEditProxyValuePolicy /// template > -class SdfMapEditProxy : - boost::totally_ordered, T> { +class SdfMapEditProxy { public: typedef T Type; typedef _ValuePolicy ValuePolicy; @@ -578,6 +576,21 @@ class SdfMapEditProxy : return _Validate() ? _CompareEqual(other) : false; } + bool operator!=(const Type& other) const + { + return !(*this == other); + } + + friend bool operator==(const Type& lhs, const SdfMapEditProxy& rhs) + { + return rhs == lhs; + } + + friend bool operator!=(const Type& lhs, const SdfMapEditProxy& rhs) + { + return rhs != lhs; + } + bool operator<(const Type& other) const { return _Validate() ? _Compare(other) < 0 : false; @@ -588,6 +601,36 @@ class SdfMapEditProxy : return _Validate() ? _Compare(other) > 0 : false; } + bool operator>=(const Type& other) const + { + return !(*this < other); + } + + bool operator<=(const Type& other) const + { + return !(*this > other); + } + + friend bool operator<(const Type& lhs, const SdfMapEditProxy& rhs) + { + return rhs > lhs; + } + + friend bool operator>(const Type& lhs, const SdfMapEditProxy& rhs) + { + return rhs < lhs; + } + + friend bool operator<=(const Type& lhs, const SdfMapEditProxy& rhs) + { + return rhs >= lhs; + } + + friend bool operator>=(const Type& lhs, const SdfMapEditProxy& rhs) + { + return rhs <= lhs; + } + template bool operator==(const SdfMapEditProxy& other) const {