Closed Ryan-rsm-McKenzie closed 4 years ago
@Ryan-rsm-McKenzie Thanks for your question/suggestion. I wasn't aware yet of these deduction guides. I'll take a look, will not be immediately though.
span iterator deduction guide:
template<class It, class EndOrSize>
span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>>;
Constraints: It satisfies contiguous_iterator. std::iter_reference_t (C++20, p1037) std::remove_reference_t (C++14/C++11)
The new deduction guides are failing to deduce reference types for iterators, presumably because of this line: https://github.com/martinmoene/span-lite/blob/81f7b15ea0a806718bd2ac72db5f09915d7e4843/include/nonstd/span.hpp#L665
Here's a godbolt link.
Thanks @Ryan-rsm-McKenzie for your feedback. Currently my attention is a bit too scattered to do a good job in one go. A little back and forth may help :)
Having a look at it...
@Ryan-rsm-McKenzie I think this issue can be closed, otherwise please reopen it.
You're missing an iterator based constructor, so code like this won't compile.
I can't re-open the issue because you closed it
this works
Thanks @Ryan-rsm-McKenzie !
Is any support for this planned? See here and here for reference.