Skip to content

Commit

Permalink
stop using deprecated std::iterator
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chadaustin authored and facebook-github-bot committed Aug 28, 2020
1 parent db7a54a commit 8dc2d39
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions folly/container/detail/F14Policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,17 @@ struct BasePolicy

// BaseIter is a convenience for concrete set and map implementations
template <typename ValuePtr, typename Item>
class BaseIter : public std::iterator<
std::forward_iterator_tag,
std::remove_const_t<
typename std::pointer_traits<ValuePtr>::element_type>,
std::ptrdiff_t,
ValuePtr,
decltype(*std::declval<ValuePtr>())> {
class BaseIter {
private:
using pointee = typename std::pointer_traits<ValuePtr>::element_type;

public:
using iterator_category = std::forward_iterator_tag;
using value_type = std::remove_const_t<pointee>;
using difference_type = std::ptrdiff_t;
using pointer = ValuePtr;
using reference = pointee&;

protected:
using Chunk = F14Chunk<Item>;
using ChunkPtr =
Expand Down

0 comments on commit 8dc2d39

Please sign in to comment.