Bug 5696 – Templates typetuple iteration

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-03-04T09:48:00Z
Last change time
2011-09-24T23:23:48Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-03-04T09:48:45Z
I am allowed to create a type tuple of function templates, but then it seems I am not allowed to use a static foreach on that type tuple: template TypeTuple(TList...) { alias TList TypeTuple; } int foo(T)(T x) { return 0; } void main() { alias TypeTuple!(foo, foo) t2; static assert(t2[0](0) == 0); // OK static assert(t2[1](0) == 0); // OK foreach (t; t2) {} // Error } DMD 2.052 shows: test.d(11): Error: variable test.main.t voids have no value test.d(11): Error: template foo(T) has no value test.d(11): Error: variable test.main.t voids have no value test.d(11): Error: template foo(T) has no value See also bug 2411
Comment #1 by k.hara.pg — 2011-09-22T11:42:00Z
Comment #2 by bugzilla — 2011-09-24T23:23:48Z