From f33ec6fb1843ac84790f448e78c2c9013ea422bf Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Sun, 25 Jun 2017 00:00:08 +0000 Subject: [PATCH] [Support] Don't use std::iterator, it's deprecated in C++17. In converting this over to iterator_facade_base, some member operators and methods are no longer needed since iterator_facade implements them in the base class using CRTP. Differential Revision: https://reviews.llvm.org/D34223 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306230 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/Path.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/llvm/Support/Path.h b/include/llvm/Support/Path.h index 6ac51195519..e5979674cf1 100644 --- a/include/llvm/Support/Path.h +++ b/include/llvm/Support/Path.h @@ -17,6 +17,7 @@ #define LLVM_SUPPORT_PATH_H #include "llvm/ADT/Twine.h" +#include "llvm/ADT/iterator.h" #include "llvm/Support/DataTypes.h" #include @@ -49,7 +50,8 @@ enum class Style { windows, posix, native }; /// C:\foo\bar => C:,/,foo,bar /// @endcode class const_iterator - : public std::iterator { + : public iterator_facade_base { StringRef Path; ///< The entire path. StringRef Component; ///< The current component. Not necessarily in Path. size_t Position; ///< The iterators current position within Path. @@ -61,10 +63,8 @@ class const_iterator public: reference operator*() const { return Component; } - pointer operator->() const { return &Component; } const_iterator &operator++(); // preincrement bool operator==(const const_iterator &RHS) const; - bool operator!=(const const_iterator &RHS) const { return !(*this == RHS); } /// @brief Difference in bytes between this and RHS. ptrdiff_t operator-(const const_iterator &RHS) const; @@ -76,7 +76,8 @@ public: /// \a path in reverse order. The traversal order is exactly reversed from that /// of \a const_iterator class reverse_iterator - : public std::iterator { + : public iterator_facade_base { StringRef Path; ///< The entire path. StringRef Component; ///< The current component. Not necessarily in Path. size_t Position; ///< The iterators current position within Path. @@ -87,10 +88,8 @@ class reverse_iterator public: reference operator*() const { return Component; } - pointer operator->() const { return &Component; } reverse_iterator &operator++(); // preincrement bool operator==(const reverse_iterator &RHS) const; - bool operator!=(const reverse_iterator &RHS) const { return !(*this == RHS); } /// @brief Difference in bytes between this and RHS. ptrdiff_t operator-(const reverse_iterator &RHS) const; -- 2.50.1