isStringLiteral

Indicates wether something is a value known at compile time.

  1. template isCompileTimeValue(alias V, T...)
  2. template isCompileTimeValue(V, T...)
  3. template isStringLiteral(V)
    template isStringLiteral (
    V
    ) {
    enum isStringLiteral;
    }

Parameters

V

The value to test.

Examples

1 string a;
2 enum b = "0";
3 enum c = 0;
4 static assert(!isCompileTimeValue!a);
5 static assert(isCompileTimeValue!b);
6 static assert(isCompileTimeValue!c);
7 static assert(isCompileTimeValue!(b,string));
8 static assert(isCompileTimeValue!(c,int));
9 static assert(!isCompileTimeValue!(c,char));
10 static assert(!isCompileTimeValue!(char));
1 string a;
2 enum b = "0";
3 enum c = 0;
4 static assert(!isStringLiteral!a);
5 static assert(isStringLiteral!b);
6 static assert(!isStringLiteral!c);
7 static assert(!isStringLiteral!int);

Meta