[Issue 12728] New: GIT HEAD : Error X is not of arithmetic type
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat May 10 01:53:02 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12728
Issue ID: 12728
Summary: GIT HEAD : Error X is not of arithmetic type
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: temtaime at gmail.com
struct Matrix(T, uint M, uint N = M, ubyte _F = 0) {
pure opBinary(string op : `*`, uint R)(auto ref in Matrix!(T, N, R) b)
const { return Matrix!(T, M, R)(); }
pure opUnary(string op: `-`)() const { return Matrix(); }
ref translate()(auto ref in Vector3 v) { return this; }
}
alias Vector(T, uint M) = Matrix!(T, 1, M);
alias Matrix4 = Matrix!(float, 4);
alias Vector3 = Vector!(float, 3);
void main() {
Matrix4 m;
m * m.translate(-Vector3());
}
This code should work and works on 065.
--
More information about the Digitalmars-d-bugs
mailing list