class C {} union U {} struct S {} interface I {} static assert( isAggregateType!C); static assert( isAggregateType!U); static assert( isAggregateType!S); static assert( isAggregateType!I); static assert(!isAggregateType!void); static assert(!isAggregateType!string); static assert(!isAggregateType!(int[])); static assert(!isAggregateType!(C[string])); static assert(!isAggregateType!(void delegate(int))); enum ES : S { a = S.init } enum EC : C { a = C.init } enum EI : I { a = I.init } enum EU : U { a = U.init } static assert( isAggregateType!ES); static assert( isAggregateType!EC); static assert( isAggregateType!EI); static assert( isAggregateType!EU);
Detect whether type T is an aggregate type.