Value or Reference Semantics Trait

Dicebot public at dicebot.lv
Mon Jan 13 05:44:16 PST 2014


On Monday, 13 January 2014 at 13:41:30 UTC, Orvid King wrote:
> If you just want to check if specifically it's a structure, you 
> could
> always check `__traits(compiles, T()) && if(typeof(T()) == T)` 
> beware
> however that this will evaluate to true if T is a class with a 
> static
> opCall who's return type is T.

is(T == struct)


More information about the Digitalmars-d-learn mailing list