Hi. I've got the above warning message roughly 130 times for a program I'm using. Analyzing this more carefully I've found that I'm only getting it 10 times, but multiple occurrences of the same locations. Presumably from multiple method calls.
I have no idea what causes these warnings, except that it's to do with my overloaded brackets operator.
Can anyone help me?
Code:
// Overloaded brackets operator
mType & Matrix::operator()(const int i, const int j) {
return values[j * xsize + i];
}
// Lines causing warnings
res(i, j) += (q,j) * m(i, q);
res(i, j) = (i, j) * f;
res(i,j) = (i, j) + m(i,j);
(i,j) = x;
res(i,j) = (j,i);
return Vec3D<mType>((0,0),(0,1),(0,2)); // 3 x Warnings
return Vec2D<mType>((0,0),(0,1)); // 2 x Warnings
It's very obvious that the warning only appears when the () is used with the implied "this" operator.
NB. The lines generating warnings that I have shown are not in this context. They are within seperate methods, but since the overall file is 160 lines long I chose to display them this way for now. More code is available if needed.
Thanks,
Simon