isSame/TemplateOf bug?

Ali Çehreli acehreli at yahoo.com
Wed Feb 20 05:10:43 UTC 2019


On 02/19/2019 03:21 PM, SrMordred wrote:
 > On Tuesday, 19 February 2019 at 23:03:37 UTC, Paul Backus wrote:

 >> Inside a templated struct, the name of the template, by itself,
 >> actually refers to the current instantiation. So when you write `Test`
 >> in your __traits(isSame) test, the compiler interprets it as `Test!T`.
 >
 > True!
 > writeln(Test.stringof) inside the struct give me Test!int.
 >
 > Thanks!
 >
 > Little unexpected D dark corner :P

For reference, it is the same in C++.

Ali



More information about the Digitalmars-d-learn mailing list