[Issue 12043] New: opCall does not work as template
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jan 30 09:54:38 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12043
Summary: opCall does not work as template
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: rswhite4 at googlemail.com
--- Comment #0 from rswhite4 at googlemail.com 2014-01-30 09:54:33 PST ---
This fails with:
Error: template instance f!float f is not a template declaration,
it is a variable
----
import std.stdio;
struct F {
T opCall(T = int)(int a, int b, int c) {
return cast(T)(a * b * c);
}
}
void main() {
F f;
int i = f(3,4,5);
float f_ = f!float(6, 7, 8);
}
----
I don't see why it shouldn't work.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list