Thank you very much! I'm using tango, and have a problem combining both on OSX. But I just copied the definition: template BaseTypedef(T) { static if( is( T BaseType1 == typedef ) ) alias BaseTypedef!(BaseType1) BaseTypedef; else alias T BaseTypedef; }
and it works! Great!! Hmmm... but how? in "is( T BaseType1 == typedef )" Basetype1 seems to be a variable of type T. Then calling 'alias BaseTypedef!(BaseType1) BaseTypedef;' does not seem to strip away a layer... isn't it still called on a variable of type T? Or does 'is()' do some magic? bearophile Wrote: > MLT: > > Is there a way to get the base type of location? > > See the BaseTypedef() template in the "templates" module of my dlibs (they > are for Phobos): > http://www.fantascienza.net/leonardo/so/libs_d.zip > > Bye, > bearophile