Cannot perform operations with const vectors.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmatrix |
Fix Released
|
Medium
|
Jesse Barker |
Bug Description
When trying to perform operations using const vectors I get compile time errors. For example, I would expect this to work:
const LibMatrix::vec2 v(1.0, 1.0);
const LibMatrix::vec2 p(2.0, 2.0);
LibMatrix::vec2 vp(v + p);
but it gives the following error:
error: no match for ‘operator+’ in ‘v + p’
note: candidates are:
note: const LibMatrix::tvec2<T> LibMatrix:
note: no known conversion for argument 1 from ‘const vec2 {aka const LibMatrix:
note: const LibMatrix::tvec2<T> LibMatrix:
note: no known conversion for implicit ‘this’ parameter from ‘const vec2* {aka const LibMatrix:
Similar errors occur for other operations involving const vectors and vectors or scalars.
Fixed at revision 24....