phobos/changelog/std-traits-hasStaticMember.dd

13 lines
288 B
Text

Added `std.traits.hasStaticMember` to check whether a symbol is a static member of a type.
-------
import std.traits : hasStaticMember;
struct S
{
static int globalVar;
int localVar;
}
assert( hasStaticMember!(S, "globalVar"));
assert(!hasStaticMember!(S, "localVar"));
-------