Skip to content

Commit

Permalink
Fix deprecated std::iterator usage (STL4015).
Browse files Browse the repository at this point in the history
  • Loading branch information
gibbed committed Feb 22, 2020
1 parent c3f9261 commit 2b1521b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion source/utf8/checked.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,16 @@ namespace utf8

// The iterator class
template <typename octet_iterator>
class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
class iterator {
octet_iterator it;
octet_iterator range_start;
octet_iterator range_end;
public:
typedef uint32_t value_type;
typedef uint32_t* pointer;
typedef uint32_t& reference;
typedef std::ptrdiff_t difference_type;
typedef std::bidirectional_iterator_tag iterator_category;
iterator () {}
explicit iterator (const octet_iterator& octet_it,
const octet_iterator& rangestart,
Expand Down
7 changes: 6 additions & 1 deletion source/utf8/unchecked.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,14 @@ namespace utf8

// The iterator class
template <typename octet_iterator>
class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
class iterator {
octet_iterator it;
public:
typedef uint32_t value_type;
typedef uint32_t* pointer;
typedef uint32_t& reference;
typedef std::ptrdiff_t difference_type;
typedef std::bidirectional_iterator_tag iterator_category;
iterator () {}
explicit iterator (const octet_iterator& octet_it): it(octet_it) {}
// the default "big three" are OK
Expand Down

0 comments on commit 2b1521b

Please sign in to comment.