Eponymous template with full template syntax
Ali Çehreli
acehreli at yahoo.com
Mon Jul 1 11:15:04 PDT 2013
I think main's second line used to work:
template isSmall(T)
{
enum isSmall = (T.sizeof < 12345);
}
void main()
{
static assert(isSmall!int); // <-- the usual syntax works
static assert(isSmall!int.isSmall); // <-- compilation ERROR
}
Error: template deneme.isSmall does not match any function template
declaration. Candidates are:
deneme.isSmall(T)
Error: template deneme.isSmall(T) cannot deduce template function from
argument types !()(bool)
Am I imagining it? I don't have a problem with it. :) Was the change
intentional?
Ali
More information about the Digitalmars-d-learn
mailing list