how to instantiate explicitly template parameters in struct	A(T1){this(T2)(){...}}
    Timothee Cour 
    thelastmammoth at gmail.com
       
    Mon May 13 21:32:49 PDT 2013
    
    
  
> I declared fun(T) as fun(T)() with the added parenthesis, and it
> worked (tested on dmd 2.062 / ubuntu 64bits).
sorry I reduced wrongly.
Here's the inconsistency:
----
struct A {
	this(T)(T x) {	}
}
auto fun1(){	
	auto a=A.__ctor!(int)(1); //OK
	return a;
}
auto fun2(){	
//	return A.__ctor!(int)(1); //uncomment gives Error: type A is not an
expression
}
void main(){
}
----
    
    
More information about the Digitalmars-d-learn
mailing list