Deprecated iterator in TTreeReader.h and TSeq.hxx


ROOT Version: 6.26/04 installed with mac ports
Platform: MacOS 12.4 Monterey
Compiler: clang 13.1.6


When compiling a program using ROOT headers on MacOS I get warning that the iterator used in TTreeReader.h and TSeq.hxx is deprecated:

In file included from /opt/local/libexec/root6/include/root/ROOT/RDataFrame.hxx:20:
In file included from /opt/local/libexec/root6/include/root/ROOT/RDF/RInterface.hxx:24:
In file included from /opt/local/libexec/root6/include/root/ROOT/RDF/RLazyDSImpl.hxx:16:
/opt/local/libexec/root6/include/root/ROOT/TSeq.hxx:86:35: warning: 'iterator<std::random_access_iterator_tag, unsigned int, int>' is deprecated [-Wdeprecated-declarations]
      class iterator: public std::iterator<std::random_access_iterator_tag, T, difference_type> {
                                  ^
/opt/local/libexec/root6/include/root/ROOT/RDF/RLazyDSImpl.hxx:80:22: note: in instantiation of member class 'ROOT::TSeq<unsigned int>::iterator' requested here
      for (auto slot : ROOT::TSeqU(fNSlots)) {
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/iterator.h:27:29: note: 'iterator<std::random_access_iterator_tag, unsigned int, int>' has been explicitly marked deprecated here
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 iterator
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1066:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#  define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1043:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from /opt/local/libexec/root6/include/root/ROOT/RDataFrame.hxx:20:
In file included from /opt/local/libexec/root6/include/root/ROOT/RDF/RInterface.hxx:24:
In file included from /opt/local/libexec/root6/include/root/ROOT/RDF/RLazyDSImpl.hxx:16:
/opt/local/libexec/root6/include/root/ROOT/TSeq.hxx:86:35: warning: 'iterator<std::random_access_iterator_tag, int, int>' is deprecated [-Wdeprecated-declarations]
      class iterator: public std::iterator<std::random_access_iterator_tag, T, difference_type> {
                                  ^
/opt/local/libexec/root6/include/root/ROOT/RDF/RLazyDSImpl.hxx:104:19: note: in instantiation of member class 'ROOT::TSeq<int>::iterator' requested here
      for (auto i : TSeqI(1, colLengths.size())) {
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/iterator.h:27:29: note: 'iterator<std::random_access_iterator_tag, int, int>' has been explicitly marked deprecated here
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 iterator
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1066:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#  define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1043:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^

It’s only a warning, so not a real issue, but since I couldn’t find anyone else mentioning I thought to bring this up, in case it goes from deprecated to not existing in newer versions.

It also shows up in TMap.h:

In file included from /opt/local/libexec/root6/include/root/TGedEditor.h:19:
/opt/local/libexec/root6/include/root/TMap.h:145:30: warning: 'iterator<std::bidirectional_iterator_tag, TObject *, long, const TObject **, const TObject *&>' is deprecated [-Wdeprecated-declarations]
                 public std::iterator<std::bidirectional_iterator_tag,
                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/iterator.h:27:29: note: 'iterator<std::bidirectional_iterator_tag, TObject *, long, const TObject **, const TObject *&>' has been explicitly marked deprecated here
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 iterator
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1066:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#  define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1043:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^

Hi @vaubee ,

thank you for reporting, all these warnings have been fixed in ROOT’s master branch. I do not think we backported them to v6.26.06 or the upcoming v6.26.08, but we probably should, I’ll ping the relevant people.

Cheers,
Enrico

Small update: thanks to @ikabadzhov the warnings are now also fixed in the v6-26-00-patches branch, that is future v6.26.08.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.