[dmd-beta] rvalue references

Michel Fortin michel.fortin at michelf.com
Wed Apr 11 05:50:18 PDT 2012


Le 2012-04-10 à 23:36, Jason House a écrit :

> While I have no plans to use it, what mechanism, if any, will allow escaping the address? Usually, casts are the back door, but I don't believe that works in this case.

There's always this middle ground: taking the address of a ref could give you a void*. That way you really can't do anything unsafe with it without a cast.

Heck, with this trick you could even allow SafeD to take the address of anything. You wouldn't be able to do much without a cast beside comparing and printing addresses, but even that could be handy for debugging and checking for aliasing.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the dmd-beta mailing list