Marking the immutable parameters as const can help the developer spot some errors.
I initially added const to the vector parameter of c_guMtxRotAxisRad(), but then the build failed because indeed the parameter is being modified by the function (which internally calls c_guVecNormalize() on it). This is a bit of a surprise, I'm tempted to modify the function implementation to create a copy of the vector, but first I wanted to check with you, to see if you agree. Another option is to add const and document that the vector must be normalized, but this would be a behavioural change which might break existing clients. Or we just leave it as it is :-)
Marking the immutable parameters as const can help the developer spot some errors.
I initially added
const
to the vector parameter ofc_guMtxRotAxisRad()
, but then the build failed because indeed the parameter is being modified by the function (which internally callsc_guVecNormalize()
on it). This is a bit of a surprise, I'm tempted to modify the function implementation to create a copy of the vector, but first I wanted to check with you, to see if you agree. Another option is to addconst
and document that the vector must be normalized, but this would be a behavioural change which might break existing clients. Or we just leave it as it is :-)