Closed lewissbaker closed 3 years ago
I don't necessarily think we should do that without running it through LEWG, especially as we have the allocator now. Well, tbh, I struggle being sympathetic with abi-motivated designs even if i know it will come back to haunt us. So, maybe you are right?
Closing as wont-fix for now as CTAD is now viable with the extra template parameter added to elements_of.
The current implementation defines
std::ranges::elements_of<Range>
using CTAD to allow use like a function insideco_yield std::ranges::elements_of(someRange)
expressions.This choice, however, makes it difficult to later add overloads of
std::ranges::elements_of()
that might take additional arguments. e.g. an allocator if we wanted to allow overriding the allocator to be used for the implicit coroutine in someco_yield std::ranges::elements_of(range, alloc);
expressions.We should change
elements_of()
to be a function that returns the typeelements_of_t<Range>
instead of being a type to be used with CTAD to keep open this evolutionary pathway for the API.