Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • Kea Kea
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 571
    • Issues 571
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 57
    • Merge requests 57
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • KeaKea
  • Issues
  • #2617
Closed
Open
Issue created Oct 26, 2022 by Andrei Pavel@andreiMaintainer

Wdeprecated-declarations warnings on std::iterator

Started getting these warnings after the migration to sysrepo v2. These should be all of them:

 encode/base_n.cc:170:33: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations]
  170 | class DecodeNormalizer : public iterator<input_iterator_tag, char> {
      |                                 ^~~~~~~~
encode/base_n.cc:115:33: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations]
  115 | class EncodeNormalizer : public iterator<input_iterator_tag, uint8_t> {
      |                                 ^~~~~~~~
../../../src/lib/dns/message.h:91:37: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations]
   91 | class SectionIterator : public std::iterator<std::input_iterator_tag, T> {
      |                                     ^~~~~~~~
 ../../../src/lib/dns/rrset_collection_base.h:156:27: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations]
  156 |     class Iterator : std::iterator<std::forward_iterator_tag,
      |                           ^~~~~~~~

The paper that deprecated it seems to have done so because of the bad practice of having to derive classes in the std library.

Proposing to fix them. After minimal research, it would seem that removing the inheritance and having a few using declarations inside the formerly-derived class is sufficient e.g.:

    using iterator_category = std::input_iterator_tag;
    using value_type = T;
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking