[dmd-beta] rvalue references

Jonathan M Davis jmdavisProg at gmx.com
Thu Apr 12 23:12:13 PDT 2012


On Thursday, April 12, 2012 23:24:17 Andrej Mitrovic wrote:
> Currently you don't have to use address-of operator if you mark the
> extern(C) function as taking ref:

I consider that to be non-issue. You're calling C code. It's normal to then 
have to use C constructs. And arguably, while calling C code shouldn't be 
hard, it _shouldn't_ be pretty, because it's inherently unsafe.

> But if both of these get banned, the only way to pass by reference
> while still keeping the same API would be to create a new temporary:

_This_ on the other hand is bad, and I think that it's a good argument for 
allowing the address of refs to be taken in @system code. Not being able to 
take the address of a ref to pass to a C function would be a definite problem.

- Jonathan M Davis


More information about the dmd-beta mailing list