From 8dc2d39f8e903529ff8ab44c08c246d4c7dd8f49 Mon Sep 17 00:00:00 2001 From: Chad Austin Date: Fri, 28 Aug 2020 16:19:57 -0700 Subject: [PATCH] stop using deprecated std::iterator Summary: std::iterator was deprecated in C++17, so define the iterator trait properties directly. This fixes warnings during compilation with Clang on Windows. Reviewed By: yfeldblum Differential Revision: D23353495 fbshipit-source-id: 7c6c0b7fb175251260e5b519ce98bd679b6c99c4 --- folly/container/detail/F14Policy.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/folly/container/detail/F14Policy.h b/folly/container/detail/F14Policy.h index 124f3fa5c12..c1c7be6f2fc 100644 --- a/folly/container/detail/F14Policy.h +++ b/folly/container/detail/F14Policy.h @@ -412,13 +412,17 @@ struct BasePolicy // BaseIter is a convenience for concrete set and map implementations template -class BaseIter : public std::iterator< - std::forward_iterator_tag, - std::remove_const_t< - typename std::pointer_traits::element_type>, - std::ptrdiff_t, - ValuePtr, - decltype(*std::declval())> { +class BaseIter { + private: + using pointee = typename std::pointer_traits::element_type; + + public: + using iterator_category = std::forward_iterator_tag; + using value_type = std::remove_const_t; + using difference_type = std::ptrdiff_t; + using pointer = ValuePtr; + using reference = pointee&; + protected: using Chunk = F14Chunk; using ChunkPtr =