josherrickson / rlemon

rlemon - R interface to C++ LEMON graph library
http://errickson.net/rlemon/
8 stars 3 forks source link

struct std::iterator’ is deprecated #37

Closed josherrickson closed 1 year ago

josherrickson commented 1 year ago

Getting a warning on CRAN checks:

Found the following significant warnings: ../inst/lemon/maps.h:1973:21: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations] ../inst/lemon/maps.h:3135:21: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations] See https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-gcc/rlemon-00install.html for details.

josherrickson commented 1 year ago

It looks like this is an issue inside LEMON, not our code. https://stackoverflow.com/questions/43268146/why-is-stditerator-deprecated

I'm open to ideas of how to address this (both this specific case and other issues with LEMON going forward). Development of LEMON has stalled; the last commit was in 2020. So this likely won't be the last time we hit an issue like this.

josherrickson commented 1 year ago

We've now got a deadline from CRAN:

Please correct before 2023-02-26 to safely retain your package on CRAN.

The new warnings come from adopting C++17 as the default C++17 dialect which deprecated std::iterator

I've found these couple of references, if they help: https://stackoverflow.com/questions/37031805/preparation-for-stditerator-being-deprecated, https://www.fluentcpp.com/2018/05/08/std-iterator-deprecated/

josherrickson commented 1 year ago

This issue has been addressed.