std.traits : Select - could it be better?

Steven Schveighoffer schveiguy at yahoo.com
Fri Jul 6 13:48:46 UTC 2018


On 7/5/18 10:17 PM, SrMordred wrote:
> I find another solution :)
> 
> template Try(alias T, Args...)
> {
>      static if( is( T!Args ) )
>          alias Try = T!Args;
> }
> 
> alias U = Select!( isPointer!T, Try!( PointerTarget, T ), T );
> 

I like it!

-Steve


More information about the Digitalmars-d mailing list