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
… `SdfPayload`
  • Loading branch information
nvmkuruc committed Jun 27, 2023
1 parent df0e5a5 commit 228f591
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions pxr/usd/sdf/payload.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include "pxr/usd/sdf/path.h"
#include "pxr/base/tf/hash.h"

#include <boost/operators.hpp>

#include <iosfwd>
#include <string>
#include <vector>
Expand All @@ -57,7 +55,7 @@ typedef std::vector<SdfPayload> SdfPayloadVector;
/// system behaviors will not traverse across, providing a user-visible
/// way to manage the working set of the scene.
///
class SdfPayload : boost::totally_ordered<SdfPayload> {
class SdfPayload {
public:
/// Create a payload. See SdfAssetPath for what characters are valid in \p
/// assetPath. If \p assetPath contains invalid characters, issue an error
Expand Down Expand Up @@ -107,10 +105,30 @@ class SdfPayload : boost::totally_ordered<SdfPayload> {
/// Returns whether this payload equals \a rhs.
SDF_API bool operator==(const SdfPayload &rhs) const;

/// \sa SdfPayload::operator==
bool operator!=(const SdfPayload& rhs) const {
return !(*this == rhs);
}

/// Returns whether this payload is less than \a rhs.
/// The meaning of less than is arbitrary but stable.
SDF_API bool operator<(const SdfPayload &rhs) const;

/// \sa SdfPayload::operator<
bool operator>(const SdfPayload& rhs) const {
return rhs < *this;
}

/// \sa SdfPayload::operator<
bool operator<=(const SdfPayload& rhs) const {
return !(rhs < *this);
}

/// \sa SdfPayload::operator<
bool operator>=(const SdfPayload& rhs) const {
return !(*this < rhs);
}

private:
friend inline size_t hash_value(const SdfPayload &p) {
return TfHash::Combine(
Expand Down

0 comments on commit 228f591

Please sign in to comment.