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 <[email protected]>
>To: Discuss the dmd beta releases for D <[email protected]> 
>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
>[email protected]
>http://michelf.com/
>
>
>
>_______________________________________________
>dmd-beta mailing list
>[email protected]
>http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
>
>
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to