So I was joyfully working on my CG assignment when I came about this little piece of code:
void Exercise13::lerp(
float & result,
const float & a,
const float & b,
const float & t)
{
\\My Code
result = ((1-t)*a)+(t*b);
}
So in effect they not only have a function that teaches the students to code in a horrible way (and yes, some have adopted such quirks), they have even made it harder for the compiler to inline a function that would be trivially inlinable.
Also, since we are working on 32bit machines or higher the whole pass by reference won't do anything to improve memory load (since the address will be just as large as a float). The only thing that would save this memory load would be... inlining.
Now I hope that my compiler is smart enough to figure this out, but shouldn't we just use language features?