Re: is(typeof(...)) vs __traits(compiles, ...)

2020-02-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/21/20 5:15 AM, drug wrote: Currently this code does not compiles: ``` unittest {     class MyClass     {     T opCall(T)(T p)     {     return p;     }     }     import std.container.array : Array;     Array!MyClass arr; } ``` but if you comment out `opCall`

is(typeof(...)) vs __traits(compiles, ...)

2020-02-21 Thread drug via Digitalmars-d-learn
Currently this code does not compiles: ``` unittest { class MyClass { T opCall(T)(T p) { return p; } } import std.container.array : Array; Array!MyClass arr; } ``` but if you comment out `opCall` in MyClass this code compiles. This is