-
Notifications
You must be signed in to change notification settings - Fork 72
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
indexed(histogram) not usable with ranges #355
Comments
It seems that the iterators returned by |
It is not the iterator concept. #include <ranges>
#include <boost/histogram.hpp>
template<std::input_or_output_iterator I>
void test_iter(I) {}
int main() {
using namespace boost::histogram;
auto hist = make_histogram(axis::integer(1, 2));
auto ind = indexed(hist);
// this works
test_iter(ind.begin());
// this fails
auto r2 = std::ranges::subrange(ind.begin(), ind.end());
return 0;
} |
Using indexed in ranges is currently not supported, it is untested. I will try to support this, since the syntax is nice and it makes sense to use an indexed in a range expression to strip the flow content. |
While a
boost::histogram
can be used as a range in C++20, anindexed(histogram)
cannot. At least for me (tested with clang++ 13 and g++ 11.3), the following code does not compile:The text was updated successfully, but these errors were encountered: