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 pxr/usd/pcp/site.h #2253

Merged
merged 1 commit into from
Jul 3, 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
38 changes: 35 additions & 3 deletions pxr/usd/pcp/site.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "pxr/usd/sdf/types.h"
#include "pxr/base/tf/declarePtrs.h"

#include <boost/operators.hpp>
#include <iosfwd>

PXR_NAMESPACE_OPEN_SCOPE
Expand All @@ -43,7 +42,7 @@ class PcpLayerStackSite;
///
/// A site specifies a path in a layer stack of scene description.
///
class PcpSite : boost::totally_ordered<PcpSite>
class PcpSite
{
public:
PcpLayerStackIdentifier layerStackIdentifier;
Expand All @@ -63,10 +62,26 @@ class PcpSite : boost::totally_ordered<PcpSite>

PCP_API
bool operator==(const PcpSite &rhs) const;

bool operator!=(const PcpSite &rhs) const {
return !(*this == rhs);
}

PCP_API
bool operator<(const PcpSite &rhs) const;

bool operator<=(const PcpSite &rhs) const {
return !(rhs < *this);
}

bool operator>(const PcpSite &rhs) const {
return rhs < *this;
}

bool operator>=(const PcpSite &rhs) const {
return !(*this < rhs);
}

struct Hash {
PCP_API
size_t operator()(const PcpSite &) const;
Expand All @@ -77,7 +92,7 @@ class PcpSite : boost::totally_ordered<PcpSite>
///
/// A site specifies a path in a layer stack of scene description.
///
class PcpLayerStackSite : boost::totally_ordered<PcpLayerStackSite>
class PcpLayerStackSite
{
public:
PcpLayerStackRefPtr layerStack;
Expand All @@ -92,9 +107,26 @@ class PcpLayerStackSite : boost::totally_ordered<PcpLayerStackSite>
PCP_API
bool operator==(const PcpLayerStackSite &rhs) const;

bool operator!=(const PcpLayerStackSite &rhs) const {
return !(*this == rhs);
}

PCP_API
bool operator<(const PcpLayerStackSite &rhs) const;

bool operator<=(const PcpLayerStackSite &rhs) const {
return !(rhs < *this);
}

bool operator>(const PcpLayerStackSite &rhs) const {
return rhs < *this;
}

bool operator>=(const PcpLayerStackSite &rhs) const {
return !(*this < rhs);
}


struct Hash {
PCP_API
size_t operator()(const PcpLayerStackSite &) const;
Expand Down