On 1/16/2015 2:13 PM, Steven Schveighoffer wrote:
I can potentially see a situation like this:

auto fun(T)(return ref T x)

Where the auto deduces to something that couldn't possibly match T or any piece
of it. Causing this function to error just because of a type mismatch is the
wrong move.

That is addressed by the DIP, it is specifically allowed that a 'return ref' can be used even when the pointer cannot be coerced into the returned ref.

This is so that the 'return ref' can refer to a container that completely owns its contents, and this ownership can thus be transferred to the output.

Reply via email to