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
[expos.only.func] Should we move decay-copy to [range.adaptors.general] ? #5044
Comments
If we do add another use for it outside that clause we'd need to move it back again, so I'm not sure it's worth it. |
Can't we just replace uses of |
Yes, that's what the "auto" paper did in the places where it is applicable. However, decay-copy and auto have some subtle difference, and the remaining uses are not obviously auto-able. |
What are the differences? "auto" was pitched as "decay-copy in the language"...? |
I think "auto" doesn't materialize temporaries per se (it just passes through an rvalue argument as an rvalue, thanks to "guaranteed copy elision"), whereas decay-copy always materializes a temporary from an rvalue, because it's pitched as a "real" function. |
Oh, that's subtle -- thanks! Does that make a difference in the library? |
Yes, which is why LWG asked for changes to P0849 so that it didn't replace all uses. |
What about |
I think the uses of |
I think we've established that There is also little support for moving the definition of decay-copy. |
After adopting P0849R8 and P2321R2 (with some editorial changes), only range adaptor objects
views::all
,views::take
, andviews::drop
are still specified viadecay-copy
. So perhaps it's OK to movedecay-copy
to [range.adaptors.general].The text was updated successfully, but these errors were encountered: