On Saturday, 1 September 2012 at 00:47:20 UTC, bearophile wrote:
Danny Arends:

Another post: http://www.dannyarends.nl/?viewDetailed=00030

pure mat!(T)[3][] gen_rotationmatrices(T = float)(){

I suggest to write something like this (note the casing and other details):

Mat!T[3][] genRotationMatrices(T = float)() pure {


Again many thanks for the feedback.
I'll fix this indeed :)


tmp += mixin('A[i][k] '~op~' B[k][j]');

This seems OK, but it looks a bit convoluted. Maybe something like this works (untested):

tmp += A[i][k].opBinary!op(B[k][j]);



I'll test it, though I wanted to show off the mixin concept, I put a hyper link to the Dlang information page about mixins. So that people can read up on what they are.


pure auto yaw(int deg){
   deg = degreeloop(deg);
   return cast(matrix)rmatrix[deg][YAW];
}

I suggest generally to try to avoid casts, where possible.


Do you have a suggestion to get around this cast ?

Bye,
bearophile

Gr,
Danny Arends

Reply via email to