[Issue 2622] New: ref returns not allowed in complex template
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jan 27 08:30:12 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2622
Summary: ref returns not allowed in complex template
Product: D
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: andrei at metalanguage.com
import std.typecons;
struct Proxy(R...)
{
Tuple!(int*, float*) ptrs;
// enable this.at!(ct_constant)
ref R[i] at(int i)();
}
void main()
{
Proxy!(int, float) p;
auto x = p.at!(1);
}
fails to compile with the error message:
variable test.Proxy!(int,float).Proxy.i only parameters or foreach declarations
can be ref
--
More information about the Digitalmars-d-bugs
mailing list