Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace boost::totally_ordered with explicit operator overloads for SdfPayload #2503

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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