memberIsValue

Aliases itself to true if the passed member of the passed aggregate is a value and not a type, a function, a template or an enum.

template memberIsValue (
Thing
string memberstring
) if (
isAggregateType!Thing &&
memberstring.length
) {}

Members

Imports

isSomeFunction (from std.traits)
public import std.traits : isSomeFunction, isType;
Undocumented in source.
isType (from std.traits)
public import std.traits : isSomeFunction, isType;
Undocumented in source.

Manifest constants

memberIsValue
enum memberIsValue;
Undocumented in source.

Parameters

Thing

Some aggregate.

memberstring

String name of the member of Thing that we want to determine is a non-type non-function non-template non-enum value.

Examples

struct Foo
{
    int i;
    void f() {}
    template t(T) {}
    enum E { abc, }
}

class Bar
{
    int i;
    void f() {}
    template t(T) {}
    enum E { abc, }
}

static assert( memberIsValue!(Foo, "i"));
static assert(!memberIsValue!(Foo, "f"));
static assert(!memberIsValue!(Foo, "t"));
static assert(!memberIsValue!(Foo, "E"));

static assert( memberIsValue!(Bar, "i"));
static assert(!memberIsValue!(Bar, "f"));
static assert(!memberIsValue!(Bar, "t"));
static assert(!memberIsValue!(Bar, "E"));

Meta