On 12/28/2014 6:29 PM, Andrei Alexandrescu wrote:
If R.front() is inout-qualified, indeed Wrapper needs to propagate that. In this
case, however, deduction can take care of it; Walter ensures me that deduction
of inout is cheap and relatively easy. I need to add a section on it to the DIP.
Here's how the deduction works. I presume the existence of a check to see if a
ref parameter is being returned by ref. If deduction is not being done, an error
message is issued:
error: 'ref' parameter 'x' is being turned by ref, needs to be 'inout ref'
If deduction is being done, the error message is not issued, but the parameter
is marked as 'inout'.