CaseyCarter / cmcstl2

An implementation of C++ Extensions for Ranges
Other
221 stars 68 forks source link

no match for call to size inside ref_view #337

Open dvirtz opened 4 years ago

dvirtz commented 4 years ago

The following code:

auto &&res = views::split(views::empty<int>, 0);
auto &&front = *begin(res);
return distance(views::ext::ref(front));

Fails to build on gcc trunk with:

/opt/compiler-explorer/libs/cmcstl2/include/stl2/view/ref.hpp:76:23: error: no match for call to '(const std::experimental::ranges::v1::__size::__fn) (std::experimental::ranges::v1::split_view<std::experimental::ranges::v1::empty_view<int>, std::experimental::ranges::v1::single_view<int> >::__outer_iterator<true>::value_type&)'

   76 |    return __stl2::size(*r_);

https://gcc.godbolt.org/z/_xdw75