Trait to identify if a type is a struct one

drug drug2004 at bk.ru
Wed Oct 18 15:16:21 UTC 2017


18.10.2017 18:11, pham пишет:
> Is there a way to identify if a type is a struct, something like isStruct
> similar to isArray.
> 
> struct X
> {
> }
> 
> isStruct!X == true?
> 
> Also, there are isAbstractClass & isFinalClass but want to check if type 
> is a class regardless? something like isClass?
> 
> Thanks
> Pham
> 
if (is(X == struct))
{
    ...
}


More information about the Digitalmars-d-learn mailing list