[Issue 2251] New: Variadic templates and auto return types don't work together.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 28 11:17:28 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2251
Summary: Variadic templates and auto return types don't work
together.
Product: D
Version: 2.017
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: dsimcha at yahoo.com
It seems that one cannot use both variadic templates tuple parameters and auto
return types in the same template function. Consider the following functions:
/*If instantiated with any of several types I tried, compile time error:
Assertion failure: '0' on line 847 in file 'glue.c'*/
auto foo(T...)(T dummyInput) {
int i = 1;
return i;
}
//Works.
int bar(T...)(T dummyInput) {
int i = 1;
return i;
}
//Works.
auto baz(T)(T dummyInput) {
int i = 1;
return i;
}
--
More information about the Digitalmars-d-bugs
mailing list