| 1 |
// https://issues.dlang.org/show_bug.cgi?id=9029 |
| 2 |
enum NameOf(alias S) = S.stringof; |
| 3 |
|
| 4 |
static assert(NameOf!int == "int"); |
| 5 |
|
| 6 |
enum BothMatch(alias S) = "alias"; |
| 7 |
enum BothMatch(T) = "type"; |
| 8 |
|
| 9 |
void foo9029() { } |
| 10 |
|
| 11 |
struct Struct { } |
| 12 |
|
| 13 |
static assert(BothMatch!int == "type"); |
| 14 |
static assert(BothMatch!(void function()) == "type"); |
| 15 |
static assert(BothMatch!BothMatch == "alias"); |
| 16 |
static assert(BothMatch!Struct == "type"); |
| 17 |
static assert(BothMatch!foo9029 == "alias"); |
| 18 |
static assert(BothMatch!5 == "alias"); |
| 19 |
|
| 20 |
// https://issues.dlang.org/show_bug.cgi?id=19884 |
| 21 |
mixin template genCtEvaluate() |
| 22 |
{ |
| 23 |
void evaluate(alias op)() { } |
| 24 |
} |
| 25 |
struct S |
| 26 |
{ |
| 27 |
mixin genCtEvaluate!() mixinEval; |
| 28 |
alias evaluate = mixinEval.evaluate; |
| 29 |
void evaluate() { } |
| 30 |
} |
| 31 |
alias List(Ops...) = Ops; |
| 32 |
void main() |
| 33 |
{ |
| 34 |
S g; |
| 35 |
foreach (op; List!(0)) |
| 36 |
{ |
| 37 |
g.evaluate!op(); |
| 38 |
} |
| 39 |
} |