Overloading opCast with multiple types

Pragma ericanderton at yahoo.removeme.com
Tue Oct 3 08:30:12 PDT 2006


Stewart Gordon wrote:
> pragma wrote:
> <snip>
>> Well, while we're on the topic, I might as well mention this variant 
>> as well. :)
>>
>> class Foobar{
>>   void* opCast(TypeInfo type){
>>     /* perform cast and return instance/value as needed
>>   }
>> }
> <snip>
> 
> How can you return an artibrary value as a void*?  Besides, it looks 
> exactly like what you proposed ages ago and I've already critiqued, as 
> you'd know if you'd read what I linked to.
> 
> Stewart.
> 

Mea culpa.

Sometimes, some ideas are hard to let go. :)

-- 
- EricAnderton at yahoo



More information about the Digitalmars-d mailing list