[Issue 954] New: Recursive templates with values, Error: T is used as a type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Feb 12 05:19:22 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=954
Summary: Recursive templates with values, Error: T is used as a
type
Product: D
Version: 1.005
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: lio at lunesu.com
template Foo( char C )
{
const Foo = true;
}
template Bar(char[] T, int F )
{
const Bar = Foo!(T[F]); //line 7
}
static assert( Bar!("asd",1) );
Results in:
t.d(7): Error: T is used as a type
t.d(7): template instance Foo!(void[1]) does not match any template declaration
t.d(7): variable t.Bar!("asd",1).Bar voids have no value
Workaround: change the reference to F in that line to "F+0"
--
More information about the Digitalmars-d-bugs
mailing list