http://d.puremagic.com/issues/show_bug.cgi?id=8588
Summary: Some troubles with ^^ of arrays Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2012-08-25 19:02:50 PDT --- import std.math; void main() { double[3] a = [1.0, 2.0, 3.0]; double[3] b = a[] ^^ 3; // OK double[3] c = [10.0, 20.0, 30.0]; double[3] d; d = (a[] - c[]) ^^ 3; // error } DMD 2.061alpha gives: test.d(7): Error: incompatible types for ((a[] - c[]) ^^ (cast(double)3)): 'double[]' and 'double' While this shows a problem even with the first form: import std.math; void foo(T)(T[] arr) {} void main() { double[3] a = [1.0, 2.0, 3.0]; foo(a[] ^^ 3); } test.d(5): Error: Array operation a[] ^^ 3L not implemented Someday in D I'd like to be able compute a distance like this: ((v1[] - v2[]) ^^ 2).sum().sqrt(); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------