Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: remove deprecated std::iterator usage #47

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

mshabunin
Copy link
Contributor

@mshabunin mshabunin commented Oct 15, 2024

Fixes warnings during OpenCV build with C++17 standard (Ubuntu 24):

[3/2101] Building CXX object CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor.cpp.o
In file included from /home/ubuntu/build/3rdparty/ade/ade-0.1.2d/sources/ade/include/ade/memory/memory_types.hpp:14,
                 from /home/ubuntu/build/3rdparty/ade/ade-0.1.2d/sources/ade/include/ade/memory/memory_descriptor.hpp:14,
                 from /home/ubuntu/build/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor.cpp:7:
/home/ubuntu/build/3rdparty/ade/ade-0.1.2d/sources/ade/include/ade/util/md_view.hpp:47:46: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
   47 | class MdViewIteratorImpl final : public std::iterator<std::random_access_iterator_tag, DiffT>
      |                                              ^~~~~~~~

Note: perhaps there was a mistake - DiffT was used as a second template argument, meaning that it will be declared value_type. While in other places in this class different declarations val_t and diff_t exist, so I used them instead.

template<
    class Category,
    class T,
    class Distance = std::ptrdiff_t,
    class Pointer = T*,
    class Reference = T&
> struct iterator;

@dmatveev dmatveev self-assigned this Oct 21, 2024
Copy link
Collaborator

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this class is used anywhere except tests, if it has tests, of course. Thanks a lot Maksim!

@dmatveev dmatveev merged commit a40f6d1 into opencv:master Oct 21, 2024
10 of 15 checks passed
@mshabunin mshabunin deleted the cpp-17 branch October 22, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants