isSame/TemplateOf bug?

SrMordred patric.dexheimer at gmail.com
Tue Feb 19 22:43:25 UTC 2019


import std.traits;
import std.stdio;

struct Test(T)
{
	this(T)( auto ref T value )
	{
                 writeln( TemplateOf!(typeof(value)).stringof);
		writeln(  __traits(isSame, TemplateOf!(typeof(value)), Test) );
	}
}

void main(){
	auto value = Test!int(Test!int());

         writeln( TemplateOf!(typeof(value)).stringof);
	writeln( __traits(isSame, TemplateOf!(typeof(value)), Test) );
}

//output:

Test(T)
false
Test(T)
true




More information about the Digitalmars-d-learn mailing list