[Issue 9238] Support rvalue references
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Dec 29 08:04:10 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9238
--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> 2012-12-29 08:04:06 PST ---
I'd like to propose using `in ref` rather than `auto ref` for the purpose.
Reasons:
1. `in ref` implies `const scope ref`.
If the reference binds temporary rvalue, its address must not escape. We don't
have correct `scope` semantics yet, but we can allow the semantic as a limited
case.
2. `in ref` is recently allowed from 2.060, by fixing issue 8105.
https://github.com/d-programming-language/dmd/commit/687044996a06535210801577e5d68b72edfa3985
We can guess that many programmers don't use `in ref`.
3. For normal function, we cannot implement the exact `auto ref` semantics as
same as for template function.
That means, `auto ref` must be used with template function.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list