[dmd-beta] rvalue references

Steve Schveighoffer schveiguy at yahoo.com
Wed Apr 11 06:02:17 PDT 2012


I like this idea, but unfortunately, void* is read/writeable -- most low-level C functions that use a buffer take void *.

I also think void[] is writeable, and can be created from a void * without a cast.

-Steve




>________________________________
> From: Michel Fortin <michel.fortin at michelf.com>
>To: Discuss the dmd beta releases for D <dmd-beta at puremagic.com> 
>Sent: Wednesday, April 11, 2012 8:50 AM
>Subject: Re: [dmd-beta] rvalue references
> 
>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/
>
>
>
>_______________________________________________
>dmd-beta mailing list
>dmd-beta at puremagic.com
>http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-beta/attachments/20120411/84b952ab/attachment.html>


More information about the dmd-beta mailing list