Why are default template parameters not permitted on class templates?

JN 666total at wp.pl
Sun Nov 29 21:52:10 UTC 2020


class ValueHolder(T = int)
{
     T t;
}

void main()
{
     ValueHolder!int v1;
     ValueHolder v2; // error
}

onlineapp.d(9): Error: template class onlineapp.ValueHolder(T = 
int) is used as a type without instantiation; to instantiate it 
use ValueHolder!(arguments)


More information about the Digitalmars-d-learn mailing list