[Issue 1456] New: Cannot use a constant with alias template parameters
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Aug 30 08:29:04 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1456
Summary: Cannot use a constant with alias template parameters
Product: D
Version: 1.020
Platform: PC
OS/Version: Windows
Status: NEW
Severity: blocker
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: samukha at voliacable.com
<code>
const int i = 20;
template Foo(alias bar)
{
}
alias Foo!(i) foo;
</code>
Error: template instance Foo!(20) does not match any template declaration
Please note that the compiler handles the situation correctly
if the initializer for i is left out:
<code>
const int i;
template Foo(alias bar)
{
alias bar Foo;
}
alias Foo!(i) foo;
pragma(msg, foo.stringof); // now foo is aliased to i as expected
</code>
D 2.0 has the same problem.
--
More information about the Digitalmars-d-bugs
mailing list