-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ Deprecation Warnings #94
Comments
I guess it is fixed since 2b1521b. |
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. |
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. |
You definitely don't have the latest version. unchecked.h:179 that causes the problem in your code looks like: And here is the current declaration of the iterator type: |
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. |
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. |
I'm not sure what you mean, honestly. I didn't modify the source code from the downloaded release. |
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? |
I have downloaded that exact same zip file. |
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> { |
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 |
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 !defined UTF_CPP_CPLUSPLUS #if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later |
Hey,
I'm working on a project using this, but I use C++20. I'm getting the following warning:
If there's something I can do about fixing this, let me know, unless the library needs to be updated to work with C++20.
The text was updated successfully, but these errors were encountered: