Code Monkey home page Code Monkey logo

Comments (4)

PhotoNomad0 avatar PhotoNomad0 commented on August 28, 2024

I was able to update GlyphCache.cpp, and graphite now compiles in Electron v20. Here is a patch:

diff --git a/src/GlyphCache.cpp b/src/GlyphCache.cpp
index 282bdc18..336de3f1 100644
--- a/src/GlyphCache.cpp
+++ b/src/GlyphCache.cpp
@@ -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 uint16(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 = std::pair<sparse::key_type, sparse::mapped_type>;
+        using pointer = std::pair<sparse::key_type, sparse::mapped_type>*;
+        using reference = std::pair<sparse::key_type, sparse::mapped_type>&;
+        
         _glat_iterator(const void * glat=0) : _e(reinterpret_cast<const byte *>(glat)), _v(_e+2*sizeof(W)), _n(0) {}
 
         _glat_iterator<W> & operator ++ () {

from graphite.

marksvc avatar marksvc commented on August 28, 2024

I was getting this error when compiling Graphite2 in FieldWorks with more recent Linux libraries / gcc. Thanks @PhotoNomad0 !

from graphite.

marksvc avatar marksvc commented on August 28, 2024

Your example gives me more confidence about implementing what I saw at https://www.fluentcpp.com/2018/05/08/std-iterator-deprecated/ .

from graphite.

PhotoNomad0 avatar PhotoNomad0 commented on August 28, 2024

Your example gives me more confidence about implementing what I saw at https://www.fluentcpp.com/2018/05/08/std-iterator-deprecated/ .

Glad it helped you!

from graphite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.