Skip to content

Commit

Permalink
graphite2: remove deprecated std::iterator
Browse files Browse the repository at this point in the history
Change-Id: I786a29a597ada820629a9a045b548bffd1df6a0c
  • Loading branch information
marksvc committed Jan 3, 2023
1 parent 855e907 commit 11884e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Lib/src/graphite2/src/GlyphCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@ namespace
// variable length structures.

template<typename W>
class _glat_iterator : public std::iterator<std::input_iterator_tag, std::pair<sparse::key_type, sparse::mapped_type> >
class _glat_iterator
{
unsigned short key() const { return be::peek<W>(_e) + _n; }
unsigned int run() const { return be::peek<W>(_e+sizeof(W)); }
void advance_entry() { _n = 0; _e = _v; be::skip<W>(_v,2); }
public:
using iterator_category = std::input_iterator_tag;
using value_type = std::pair<sparse::key_type, sparse::mapped_type>;
using difference_type = ptrdiff_t;
using pointer = value_type *;
using reference = value_type &;

_glat_iterator(const void * glat=0) : _e(reinterpret_cast<const byte *>(glat)), _v(_e+2*sizeof(W)), _n(0) {}

_glat_iterator<W> & operator ++ () {
Expand Down

0 comments on commit 11884e4

Please sign in to comment.