About variant

Justin Whear via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 27 13:00:16 PST 2015


On Tue, 27 Jan 2015 20:46:59 +0000, bioinfornatics wrote:

> void main(){
> 	auto a = Alpha!(int)( 6);
> 	auto b = Alpha!(string)( "hello");

The Alpha struct is not a template, only the constructor is.  Remove the 
explicit instantiations and IFTI does the work:
> void main(){
> 	auto a = Alpha( 6);
> 	auto b = Alpha( "hello");



More information about the Digitalmars-d-learn mailing list