From 71d350b29c6548feb74600a4c3f1b3781e04cb18 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 18 Nov 2021 11:41:23 +1000 Subject: [PATCH] remove use of std::iterator --- iterator/infix.hpp | 8 +++++++- string.hpp | 12 +++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/iterator/infix.hpp b/iterator/infix.hpp index b9b79983..5916d705 100644 --- a/iterator/infix.hpp +++ b/iterator/infix.hpp @@ -27,8 +27,14 @@ namespace cruft::iterator { class CharT = char, class Traits = std::char_traits > - class infix_iterator : public std::iterator { + class infix_iterator { public: + using iterator_category = std::output_iterator_tag; + using value_type = void; + using difference_type = void; + using reference = void; + using pointer = void; + using char_type = CharT; using traits_type = Traits; using ostream_type = std::basic_ostream; diff --git a/string.hpp b/string.hpp index 4d5bca31..0a7a67fa 100644 --- a/string.hpp +++ b/string.hpp @@ -133,12 +133,14 @@ namespace cruft { { ; } - struct iterator : public std::iterator< - std::forward_iterator_tag, - value_type, - std::size_t - > { + struct iterator { public: + using iterator_category = std::forward_iterator_tag; + using value_type = tokeniser::value_type; + using difference_type = std::size_t; + using pointer = value_type*; + using reference = value_type&; + iterator operator++ (int) { iterator res(*this);