digitalmars.D.learn - Template instantiation without (...)
- Steve Teale (20/20) Feb 07 2010 Which bit of the spec for template instantiation is it that allows the
- Daniel Murphy (2/27) Feb 07 2010 I suppose it's the part of the spec you're about to write a patch for.
- Steve Teale (2/3) Feb 07 2010 I guess so. It was discussed on one of the forums back in October 2008. ...
- Steve Teale (3/4) Feb 07 2010 Twas at:
Which bit of the spec for template instantiation is it that allows the
last two lines of the following to compile and work?
import std.stdio;
struct A
{
int a;
}
template Thingie(T)
{
static if (is(T == int))
enum Thingie = 1;
else
enum Thingie = 0;
}
void main()
{
writefln("%d", Thingie!(int));
writefln("%d", Thingie!int);
writefln("%d", Thingie!A);
}
Feb 07 2010
Steve Teale Wrote:
Which bit of the spec for template instantiation is it that allows the
last two lines of the following to compile and work?
import std.stdio;
struct A
{
int a;
}
template Thingie(T)
{
static if (is(T == int))
enum Thingie = 1;
else
enum Thingie = 0;
}
void main()
{
writefln("%d", Thingie!(int));
writefln("%d", Thingie!int);
writefln("%d", Thingie!A);
}
I suppose it's the part of the spec you're about to write a patch for.
Feb 07 2010
I suppose it's the part of the spec you're about to write a patch for.I guess so. It was discussed on one of the forums back in October 2008. I guess it got implemented but never made the documentation.
Feb 07 2010









Steve Teale <steve.teale britseyeview.com> 