isMutable

Determines whether T is mutable, i.e. has one of the following qualifiers or a combination of them:

  • $(D_KEYWORD const)
  • $(D_KEYWORD immutable)
  • $(D_KEYWORD const)

Members

Variables

isMutable
enum bool isMutable;
Undocumented in source.
isMutable
enum bool isMutable;
Undocumented in source.

Parameters

T

A type.

Return Value

$(D_KEYWORD true) if T is mutable, $(D_KEYWORD false) otherwise.

Examples

static struct S
{
    void method()
    {
        static assert(isMutable!(typeof(this)));
    }

    void method() inout
    {
        static assert(!isMutable!(typeof(this)));
    }

    void immMethod() const
    {
        static assert(!isMutable!(typeof(this)));
    }
    void immMethod() immutable
    {
        static assert(!isMutable!(typeof(this)));
    }
}

Meta