boostorg / range

Boost.org range module
http://boost.org/libs/range
43 stars 101 forks source link

Warning when using boost.range #106

Closed madmongo1 closed 4 years ago

madmongo1 commented 4 years ago

to reproduce:

check out latest develop of boost source tree (currently scheduled for 1.74 release)

$ ./bootstrap.sh
$ ./b2 toolset=clang cxxstd=latest variant=release -j 12 libs/beast//example libs/beast//test

example warning:

In file included from libs/beast/example/http/server/coro/http_server_coro.cpp:20:
In file included from ./boost/asio/spawn.hpp:19:
In file included from ./boost/coroutine/all.hpp:11:
In file included from ./boost/coroutine/coroutine.hpp:10:
In file included from ./boost/coroutine/asymmetric_coroutine.hpp:17:
In file included from ./boost/range.hpp:19:
In file included from ./boost/range/metafunctions.hpp:20:
./boost/range/result_iterator.hpp:20:1: warning: This header is deprecated. Use <boost/range/iterator.hpp> instead. [-W#pragma-messages]
BOOST_HEADER_DEPRECATED("<boost/range/iterator.hpp>")
^
jefftrull commented 4 years ago

The ODEInt library hits this as well. I assume range.hpp is a convenience header; perhaps it can be updated to use the right (non-deprecated) headers.

jefftrull commented 4 years ago

The headers const_reverse_iterator.hpp and reverse_result_iterator.hpp are also getting included, with a deprecation warning.

jefftrull commented 4 years ago

It's in metafunctions.hpp

dvhwgumby commented 4 years ago

The fix to this is trivial, and included below. Let me know if you'd prefer a pull request, but this is literally a three line fix. The correct headers are already being included, so the three obsolete ones need merely be removed.

diff -c metafunctions.hpp.orig metafunctions.hpp
*** metafunctions.hpp.orig  2020-09-11 23:38:54.000000000 -0700
--- metafunctions.hpp   2020-09-11 23:39:37.000000000 -0700
***************
*** 17,26 ****

  #include <boost/range/iterator.hpp>
  #include <boost/range/has_range_iterator.hpp>
- #include <boost/range/result_iterator.hpp>
  #include <boost/range/reverse_iterator.hpp>
- #include <boost/range/const_reverse_iterator.hpp>
- #include <boost/range/reverse_result_iterator.hpp>
  #include <boost/range/value_type.hpp>
  #include <boost/range/size_type.hpp>
  #include <boost/range/difference_type.hpp>
--- 17,23 ----
glenfe commented 4 years ago

Didn't realize there was an open issue for this or I would have closed this when I fixed it in 486c74fbeba9ee9975e6d68e974230ec8ec22fb0. Closing...