diff --git a/pxr/usd/sdf/pathTable.h b/pxr/usd/sdf/pathTable.h index aa94cb1da4..008400c96c 100644 --- a/pxr/usd/sdf/pathTable.h +++ b/pxr/usd/sdf/pathTable.h @@ -30,8 +30,6 @@ #include "pxr/base/tf/pointerAndBits.h" #include "pxr/base/tf/functionRef.h" -#include - #include #include #include @@ -202,14 +200,18 @@ class SdfPathTable // iterators. Currently only forward traversal is supported. template friend class Iterator; template - class Iterator : - public boost::iterator_facade, - ValType, boost::forward_traversal_tag> + class Iterator { public: + using iterator_category = std::forward_iterator_tag; + using value_type = ValType; + using reference = ValType&; + using pointer = ValType*; + using difference_type = std::ptrdiff_t; + /// The standard requires default construction but places practically no /// requirements on the semantics of default-constructed iterators. - Iterator() {} + Iterator() = default; /// Copy constructor (also allows for converting non-const to const). template @@ -217,6 +219,30 @@ class SdfPathTable : _entry(other._entry) {} + reference operator*() const { return dereference(); } + pointer operator->() const { return &(dereference()); } + + Iterator& operator++() { + increment(); + return *this; + } + + Iterator operator++(int) { + Iterator result(*this); + increment(); + return result; + } + + template + bool operator==(Iterator const &other) const { + return equal(other); + } + + template + bool operator!=(Iterator const &other) const { + return !equal(other); + } + /// Return an iterator \a e, defining a maximal range [\a *this, \a e) /// such that for all \a i in the range, \a i->first is \a /// (*this)->first or is prefixed by \a (*this)->first. @@ -248,7 +274,6 @@ class SdfPathTable } protected: - friend class boost::iterator_core_access; friend class SdfPathTable; template friend class Iterator; @@ -256,8 +281,6 @@ class SdfPathTable : _entry(entry) {} // Fundamental functionality to implement the iterator. - // boost::iterator_facade will invoke these as necessary to implement - // the full iterator public interface. // Iterator increment. inline void increment() {