We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
std::span
Algorithms like find_if do not compile when used on instances of std::span. They work with boost::span.
find_if
boost::span
You can try this code on https://godbolt.org/z/Mq4GhqMYn:
#include <ranges> #include <span> #include <boost/core/span.hpp> #include <boost/range/algorithm/find.hpp> constexpr int a[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; boost::span boost_span{a}; std::span std_span{a}; auto foo0() { return boost::range::find(boost_span, 2); // ok } auto foo1() { return boost::range::find(std_span, 2); // fails } auto foo2() { return std::ranges::find(boost_span, 2); // ok } auto foo3() { return std::ranges::find(std_span, 2); // ok }
The error message is something like
error: no type named 'type' in 'struct boost::range_iterator<const std::span<const int, 9>, void>'
The text was updated successfully, but these errors were encountered:
The problem depends by std::span that does not provice a std::span<T>::const_iterator, that is usually provided by the other standard containers.
std::span<T>::const_iterator
Could be related to https://stackoverflow.com/questions/62757700/why-does-stdspan-lack-cbegin-and-cend-methods
Sorry, something went wrong.
No branches or pull requests
Algorithms like
find_if
do not compile when used on instances ofstd::span
. They work withboost::span
.You can try this code on https://godbolt.org/z/Mq4GhqMYn:
The error message is something like
error: no type named 'type' in 'struct boost::range_iterator<const std::span<const int, 9>, void>'
The text was updated successfully, but these errors were encountered: