typeof()

Walter Bright newshound2 at digitalmars.com
Sat Oct 22 12:37:51 PDT 2011


On 10/20/2011 12:25 AM, Jens Mueller wrote:
> J Arrizza wrote:
>> typeof returns the type of the object given to it:
>>
>>      SomeClass sc;
>>      typeof(sc)  // returns SomeClass
>>
>>      Object o = sc;
>>      typeof(o) // returns Object
>>
>> Is there a way or call to get the underlying type?:
>>
>>      typeof2(o) //returns SomeClass
>>
>> I checked the online doc, but nothing in the Declarations section that I
>> could see.

typeof2 would have to work at runtime, meaning it cannot participate in static 
type checking, or template expansion, etc.


More information about the Digitalmars-d mailing list