hi all, i get the folloing error messages from DJGPPv2 (GNU C++)
Warning: initialization of nonconst 'Vector &' from rvalue 'Vector'
Warning: in passing argument 1 of 'Vector::operator =(Vector &)'
here's the relevent code snips... if anyone can tell me how to make
these warnings go away i would be grateful.
class Vector {
public:
double x, y, z;
Vector();
Vector(double x1, double y1, double z1);
Vector (Vector &);
Vector operator=(Vector &);
}
Vector Vector::operator=(Vector &b)
{
x = b.x;
y = b.y;
z = b.z;
return *this;
}
int main(void)
{
Vector points[NUM_VECT];
Matrix m;
points[0] = Vector( 90, -50, 0); /* warning here */
points[1] = Vector( 0, -90, 0); /* & here */
}
... "I find your lack of faith disturbing." - Vader
--- EzyBlueWave/2 V1.49b2 00F90061
---------------
* Origin: Gaz's Grotto #2 Adelaide +61-8-8351-8670 33k6 (3:800/2)
|