remove use of std::iterator

This commit is contained in:
Danny Robson 2021-11-18 11:41:23 +10:00
parent 56828688b5
commit 71d350b29c
2 changed files with 14 additions and 6 deletions

View File

@ -27,8 +27,14 @@ namespace cruft::iterator {
class CharT = char, class CharT = char,
class Traits = std::char_traits<CharT> class Traits = std::char_traits<CharT>
> >
class infix_iterator : public std::iterator<std::output_iterator_tag, void, void, void, void> { class infix_iterator {
public: 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 char_type = CharT;
using traits_type = Traits; using traits_type = Traits;
using ostream_type = std::basic_ostream<char_type, traits_type>; using ostream_type = std::basic_ostream<char_type, traits_type>;

View File

@ -133,12 +133,14 @@ namespace cruft {
{ ; } { ; }
struct iterator : public std::iterator< struct iterator {
std::forward_iterator_tag,
value_type,
std::size_t
> {
public: 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 operator++ (int)
{ {
iterator res(*this); iterator res(*this);