isAggregateType

Determines whether T is an aggregate type.

Aggregate types are:

  • $(D_KEYWORD struct)s
  • $(D_KEYWORD class)es
  • $(D_KEYWORD interface)s
  • $(D_KEYWORD union)s
enum bool isAggregateType(T);

Return Value

$(D_KEYWORD true) if T is an aggregate type, $(D_KEYWORD false) otherwise.

Examples

static struct S;
class C;
interface I;
union U;
enum E;

static assert(isAggregateType!S);
static assert(isAggregateType!C);
static assert(isAggregateType!I);
static assert(isAggregateType!U);
static assert(!isAggregateType!E);
static assert(!isAggregateType!void);

Meta