Remove inheritance from std::iterator Topic is solved

What it says on the tin: a place to discuss proposed new features.
Post Reply
Posts: 215
Joined: Thu Apr 28, 2011 12:23 pm
x 25

Remove inheritance from std::iterator

Post by Pellaeon »


std::iterator is deprecated in C++17 and could be removed in future versions. Atm it results in a compiler warning in OgreUTFString in line 210: warning C4996: 'std::iterator<std::random_access_iterator_tag,Ogre::UTFString::value_type,ptrdiff_t,Ogre::UTFString::value_type *,Ogre::UTFString::value_type &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.

Therefore, I request to remove it from Ogre. It can be done in a simple fashion, which is also C++03 conform! Details see e.g. ... eprecated/ or the in second half of the warning message above.

Best regards
OGRE Team Member
OGRE Team Member
Posts: 1418
Joined: Sun Mar 30, 2014 2:51 pm
x 621

Re: Remove inheritance from std::iterator

Post by paroj »

Pellaeon wrote: Fri Feb 19, 2021 9:13 am Therefore, I request to remove it from Ogre
yes, UTFString will be removed with Ogre 1.13
Post Reply