Page 1 of 1

Remove inheritance from std::iterator

Posted: Fri Feb 19, 2021 9:13 am
by Pellaeon
Hello,

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. https://www.fluentcpp.com/2018/05/08/st ... eprecated/ or the in second half of the warning message above.

Best regards

Re: Remove inheritance from std::iterator

Posted: Sun Feb 21, 2021 8:37 pm
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