isInnerClass

Tests whether T is an inner class, i.e. a class nested inside another class.

All inner classes get outer propery automatically generated, which points to its parent class, though it can be explicitly defined to be something different. If T does this, $(D_PSYMBOL isInnerClass) evaluates to $(D_KEYWORD false).

Members

Variables

isInnerClass
enum bool isInnerClass;
Undocumented in source.
isInnerClass
enum bool isInnerClass;
Undocumented in source.

Parameters

T

Class to be tested.

Returns $(D_KEYWORD true) if T is an inner class, $(D_KEYWORD false) otherwise.

Examples

class A
{
}
class O
{
    class I
    {
    }
    class Fake
    {
        bool outer;
    }
}
static assert(!isInnerClass!(O));
static assert(isInnerClass!(O.I));
static assert(!isInnerClass!(O.Fake));

Meta