Const ref and rvalues again...

Manu turkeyman at gmail.com
Tue Nov 6 14:32:48 PST 2012


But it only really makes sense in the context of templates...?
Why should something called 'auto ref' provide fabrication of temporaries
for the purpose of passing rvalues to functions that receive ref args?

How does auto ref (under some different definition/implementation) address
the rvalue problem?


On 6 November 2012 23:08, Jonathan M Davis <jmdavisProg at gmx.com> wrote:

> On Tuesday, November 06, 2012 20:40:38 Manu wrote:
> > Yeah I really don't understand how 'auto ref' entered this conversation?
> It
> > completely misses the point.
>
> The _entire_ reason that auto ref was introduced in the first place was to
> solve the const ref problem. That's what it's for. It wouldn't exist
> otherwise. So,
> it's completely relevant to any discussion of const ref.
>
> However, Walter misunderstood what Andrei meant by the feature, so it only
> got
> implemented for templates, and given how Walter implemented it, it _can't_
> be
> implemented with non-templated functions. But it could be implemented with
> slightly
> different semantics such that it solves the const ref problem as orignally
> intended.
> It's just that it would then have slightly different semantics between
> templated
> and non-templated functions.
>
> - Jonathan M Davis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121107/f9c4be74/attachment.html>


More information about the Digitalmars-d mailing list