Const ref and rvalues again...

Jonathan M Davis jmdavisProg at gmx.com
Tue Nov 6 17:33:36 PST 2012


On Wednesday, November 07, 2012 02:15:26 martin wrote:
> Wow, now this finally sheds some light on this topic. Do you have
> any links regarding their reasoning?

The most recent discussion where Walter and Andrei were part of the discussion 
was here:

http://forum.dlang.org/post/4F84D6DD.5090405@digitalmars.com

A key component of the problem is that conversions cause problems. Also, IIRC 
allowing const ref to take rvalues causes some issues with overloading.

Making some changes to ref with regards to escaping apparently could change
the situation a bit, and there's even some discussion in there of allowing ref
to take rvalues if certain other things in the language are changed, but it's
all up in the air at this point. Certainly, it's not a simple matter of just
making const ref work with rvalues like most of the people coming from C++ want
and expect.

- Jonathan M Davis


More information about the Digitalmars-d mailing list