void main() { int[3] A = [1, 2, 3]; int[3] B; B[] = A[] * 2; // OK assert(B == [2, 4, 6]); B[] = A[] * A[]; // OK assert(B == [1, 4, 9]); B[] = A[] ^^ 2; // Error assert(B == [1, 4, 9]); B[] = A[] ^^ A[]; // Error assert(B == [1, 4, 27]); } DMD 2.053 gives: test.d(8): Error: incompatible types for ((A[]) ^^ (2)): 'int[]' and 'int' test.d(10): Error: incompatible types for ((A[]) ^^ (A[])): 'int[]' and 'int[]'
This has been discussed before in bug3661 Have raised a pull request to get this code accepted, it is now up to the library folk to optimise this routine, but I believe it's something that can't be vectorised, so there will probably be no performance benefit. https://github.com/D-Programming-Language/dmd/pull/325 Regards
*** This issue has been marked as a duplicate of issue 3661 ***