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
) {
static if(!isAggregateType!Thing)
enum pattern;
static if(!isAggregateType!Thing)
enum message;
static if(!(!isAggregateType!Thing))
static if(!memberstring.length)
enum message;
static if(!(!isAggregateType!Thing))
static if(!(!memberstring.length))
enum memberIsValue;
}

Members

Imports

format (from std.format)
public import std.format : format;
Undocumented in source.
format (from std.format)
public import std.format : format;
Undocumented in source.
isAggregateType (from std.traits)
public import std.traits : isAggregateType, isMutable, isSomeFunction, isType;
Undocumented in source.
isMutable (from std.traits)
public import std.traits : isAggregateType, isMutable, isSomeFunction, isType;
Undocumented in source.
isSomeFunction (from std.traits)
public import std.traits : isAggregateType, isMutable, isSomeFunction, isType;
Undocumented in source.
isType (from std.traits)
public import std.traits : isAggregateType, isMutable, isSomeFunction, isType;
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"));