martinmoene/span-lite

Constructor from iterators is not properly constrained

krsch opened this issue · 1 comments

krsch commented

Example: https://godbolt.org/z/9MTYWPYqG
Fails with span-lite, works with std::span (e.g. by enabling -std=c++20)
The problem is that int& is convertible_to float const&. This is not true for int* and float const* so I think pointers can be used in span_REQUIRES_T on line 956, but I'm not sure if this solution has no other bugs.

Thanks!