mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 16:10:45 +03:00
13 lines
288 B
Text
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"));
|
|
-------
|