Giter VIP home page Giter VIP logo

Comments (12)

Finkman avatar Finkman commented on May 18, 2024

I guess it is fixed since 2b1521b.
You should try latest release version

from utfcpp.

TurtleP avatar TurtleP commented on May 18, 2024

Yeah, I am using the latest release version, 3.2.2. Although I'm not home at the moment to work on my code, so I can't double check right now if maybe it was some random cache issue because of CMake (I forgot to push the latest changes before leaving for the holiday, heh). I'll be back on Friday/Saturday and get back to you.

from utfcpp.

TurtleP avatar TurtleP commented on May 18, 2024

Sorry for the late reply. I double checked with a clean build and everything. It still produces the warning. It's not exactly a big deal, but it is annoying it keeps popping up.

from utfcpp.

nemtrif avatar nemtrif commented on May 18, 2024

You definitely don't have the latest version. unchecked.h:179 that causes the problem in your code looks like:
class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
That code does not exist anymore. Here is that line in the current version: https://github.com/nemtrif/utfcpp/blob/master/source/utf8/unchecked.h#L179

And here is the current declaration of the iterator type:
https://github.com/nemtrif/utfcpp/blob/master/source/utf8/unchecked.h#L218

from utfcpp.

TurtleP avatar TurtleP commented on May 18, 2024

I mean, I downloaded the latest release and replaced the files. You can confirm that here. I have no idea what I can tell you otherwise.

from utfcpp.

Finkman avatar Finkman commented on May 18, 2024

So, you mixed up your on cocktail of the lib? In that case, the issue should be moved to the cocktail. It is definitely fixed here.

from utfcpp.

TurtleP avatar TurtleP commented on May 18, 2024

I'm not sure what you mean, honestly. I didn't modify the source code from the downloaded release.

from utfcpp.

nemtrif avatar nemtrif commented on May 18, 2024

I just looked at https://github.com/nemtrif/utfcpp/archive/refs/tags/v3.2.2.zip and it is fine. What download exactly do you use?

from utfcpp.

TurtleP avatar TurtleP commented on May 18, 2024

I have downloaded that exact same zip file.

from utfcpp.

nemtrif avatar nemtrif commented on May 18, 2024

Can you extract that file into a new directory, open file unchecked.h and look for the line that causes the warning:

class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {

from utfcpp.

TurtleP avatar TurtleP commented on May 18, 2024

this is the class within unchecked.h:

        // The iterator class
        template <typename octet_iterator>
          class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> { 
            octet_iterator it;
            public:
            iterator () {}
            explicit iterator (const octet_iterator& octet_it): it(octet_it) {}
            // the default "big three" are OK
            octet_iterator base () const { return it; }
            uint32_t operator * () const
            {
                octet_iterator temp = it;
                return utf8::unchecked::next(temp);
            }
            bool operator == (const iterator& rhs) const 
            { 
                return (it == rhs.it);
            }
            bool operator != (const iterator& rhs) const
            {
                return !(operator == (rhs));
            }
            iterator& operator ++ () 
            {
                ::std::advance(it, utf8::internal::sequence_length(it));
                return *this;
            }
            iterator operator ++ (int)
            {
                iterator temp = *this;
                ::std::advance(it, utf8::internal::sequence_length(it));
                return temp;
            }  
            iterator& operator -- ()
            {
                utf8::unchecked::prior(it);
                return *this;
            }
            iterator operator -- (int)
            {
                iterator temp = *this;
                utf8::unchecked::prior(it);
                return temp;
            }
          }; // class iterator

and the #define version is UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731

from utfcpp.

nemtrif avatar nemtrif commented on May 18, 2024

Long story short you have an old version of the code. I just looked at your repository and it is obvious. You don't even have all the files from recent releases: compare: https://github.com/lovebrew/lovepotion/tree/dev/3.0/libraries/utf8/utf8 to https://github.com/nemtrif/utfcpp/tree/master/source/utf8.

Or compare https://github.com/nemtrif/utfcpp/blob/master/source/utf8/core.h to https://github.com/lovebrew/lovepotion/blob/dev/3.0/libraries/utf8/utf8/core.h

You are obviously missing this part:

`// Determine the C++ standard version.
// If the user defines UTF_CPP_CPLUSPLUS, use that.
// Otherwise, trust the unreliable predefined macro __cplusplus

#if !defined UTF_CPP_CPLUSPLUS
#define UTF_CPP_CPLUSPLUS __cplusplus
#endif

#if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later
#define UTF_CPP_OVERRIDE override
#define UTF_CPP_NOEXCEPT noexcept
#else // C++ 98/03
#define UTF_CPP_OVERRIDE
#define UTF_CPP_NOEXCEPT throw()
#endif // C++ 11 or later
`

from utfcpp.

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.