I close BIP27. I won't be pursuing BIPs anymore
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Wed Oct 19 04:36:56 PDT 2016
On 10/19/16 5:11 AM, Ethan Watson wrote:
> On Wednesday, 19 October 2016 at 05:41:17 UTC, Manu wrote:
>> People just want to be able to do this:
>>
>> void f(ref const(Vector) v);
>>
>> f(v1 + v2);
>>
>> or:
>>
>> f(Vector(10,20,30));
>>
>> That is all. The rval produces a temporary, and the temporary is
>> passed to the function.
>
> Probably worth pointing out that we laid it out exactly like this to
> Walter and Andrei at DConf, and how not having it made the Quantum Break
> animation code (all of which is 3D math) a pain to write thanks to
> having to define the temporary variables yourself. Especially when
> you're calling bound C++ functions and the programmers involved could
> compare it to C++ directly saying "Why can't we do this?"
"Because you're trying to write C++ in D." :o)
I'm just kidding. I agree it's occasionally unpleasant to have the
calling convention impose l/rvalueness depending on by ref/by value
signature. With the recent tightening of ref semantics, and if we
carefully navigate around C++'s mistake, we may be able to define a way
to meaningfully bind rvalues to ref. It's a fair amount of work, worth a
thorough DIP. Implementation is the easy part (for the most part lifting
restrictions).
Andrei
More information about the Digitalmars-d
mailing list