typeof()

Jens Mueller jens.k.mueller at gmx.de
Thu Oct 20 00:25:48 PDT 2011


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.

typeid should work.
http://d-programming-language.org/expression.html#TypeidExpression

Jens


More information about the Digitalmars-d mailing list