Skip to content

Commit

Permalink
Replace boost::totally_ordered with explicit operator overloads for…
Browse files Browse the repository at this point in the history
… `SdfMapEditProxy`
  • Loading branch information
nvmkuruc committed Jul 3, 2023
1 parent 58a76b5 commit 358b91a
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions pxr/usd/sdf/mapEditProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "pxr/base/tf/mallocTag.h"
#include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/operators.hpp>
#include <iterator>
#include <utility>

Expand Down Expand Up @@ -117,8 +116,7 @@ class SdfIdentityMapEditProxyValuePolicy {
/// \sa SdfIdentityMapEditProxyValuePolicy
///
template <class T, class _ValuePolicy = SdfIdentityMapEditProxyValuePolicy<T> >
class SdfMapEditProxy :
boost::totally_ordered<SdfMapEditProxy<T, _ValuePolicy>, T> {
class SdfMapEditProxy {
public:
typedef T Type;
typedef _ValuePolicy ValuePolicy;
Expand Down Expand Up @@ -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;
Expand All @@ -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 <class U, class UVP>
bool operator==(const SdfMapEditProxy<U, UVP>& other) const
{
Expand Down

0 comments on commit 358b91a

Please sign in to comment.