diff --git a/include/SFML/System/Vector2.inl b/include/SFML/System/Vector2.inl index 4f339451..567cfeb7 100644 --- a/include/SFML/System/Vector2.inl +++ b/include/SFML/System/Vector2.inl @@ -27,7 +27,7 @@ /// Default constructor //////////////////////////////////////////////////////////// template -Vector2::Vector2() : +inline Vector2::Vector2() : x(0), y(0) { @@ -39,7 +39,7 @@ y(0) /// Construct the color from its coordinates //////////////////////////////////////////////////////////// template -Vector2::Vector2(T X, T Y) : +inline Vector2::Vector2(T X, T Y) : x(X), y(Y) { @@ -51,7 +51,7 @@ y(Y) /// Operator - overload ; returns the opposite of a vector //////////////////////////////////////////////////////////// template -Vector2 operator -(const Vector2& left) +inline Vector2 operator -(const Vector2& left) { return Vector2(-left.x, -left.y); } @@ -61,7 +61,7 @@ Vector2 operator -(const Vector2& left) /// Operator += overload ; add two vectors and assign to the first op //////////////////////////////////////////////////////////// template -Vector2& operator +=(Vector2& left, const Vector2& right) +inline Vector2& operator +=(Vector2& left, const Vector2& right) { left.x += right.x; left.y += right.y; @@ -74,7 +74,7 @@ Vector2& operator +=(Vector2& left, const Vector2& right) /// Operator -= overload ; subtract two vectors and assign to the first op //////////////////////////////////////////////////////////// template -Vector2& operator -=(Vector2& left, const Vector2& right) +inline Vector2& operator -=(Vector2& left, const Vector2& right) { left.x -= right.x; left.y -= right.y; @@ -87,7 +87,7 @@ Vector2& operator -=(Vector2& left, const Vector2& right) /// Operator + overload ; adds two vectors //////////////////////////////////////////////////////////// template -Vector2 operator +(const Vector2& left, const Vector2& right) +inline Vector2 operator +(const Vector2& left, const Vector2& right) { return Vector2(left.x + right.x, left.y + right.y); } @@ -97,7 +97,7 @@ Vector2 operator +(const Vector2& left, const Vector2& right) /// Operator - overload ; subtracts two vectors //////////////////////////////////////////////////////////// template -Vector2 operator -(const Vector2& left, const Vector2& right) +inline Vector2 operator -(const Vector2& left, const Vector2& right) { return Vector2(left.x - right.x, left.y - right.y); } @@ -107,7 +107,7 @@ Vector2 operator -(const Vector2& left, const Vector2& right) /// Operator * overload ; multiply a vector by a scalar value //////////////////////////////////////////////////////////// template -Vector2 operator *(const Vector2& left, T right) +inline Vector2 operator *(const Vector2& left, T right) { return Vector2(left.x * right, left.y * right); } @@ -117,7 +117,7 @@ Vector2 operator *(const Vector2& left, T right) /// Operator * overload ; multiply a scalar value by a vector //////////////////////////////////////////////////////////// template -Vector2 operator *(T left, const Vector2& right) +inline Vector2 operator *(T left, const Vector2& right) { return Vector2(right.x * left, right.y * left); } @@ -127,7 +127,7 @@ Vector2 operator *(T left, const Vector2& right) /// Operator *= overload ; multiply-assign a vector by a scalar value //////////////////////////////////////////////////////////// template -Vector2& operator *=(Vector2& left, T right) +inline Vector2& operator *=(Vector2& left, T right) { left.x *= right; left.y *= right; @@ -140,7 +140,7 @@ Vector2& operator *=(Vector2& left, T right) /// Operator / overload ; divide a vector by a scalar value //////////////////////////////////////////////////////////// template -Vector2 operator /(const Vector2& left, T right) +inline Vector2 operator /(const Vector2& left, T right) { return Vector2(left.x / right, left.y / right); } @@ -150,7 +150,7 @@ Vector2 operator /(const Vector2& left, T right) /// Operator /= overload ; divide-assign a vector by a scalar value //////////////////////////////////////////////////////////// template -Vector2& operator /=(Vector2& left, T right) +inline Vector2& operator /=(Vector2& left, T right) { left.x /= right; left.y /= right; @@ -163,7 +163,7 @@ Vector2& operator /=(Vector2& left, T right) /// Operator == overload ; compares the equality of two vectors //////////////////////////////////////////////////////////// template -bool operator ==(const Vector2& left, const Vector2& right) +inline bool operator ==(const Vector2& left, const Vector2& right) { return (left.x == right.x) && (left.y == right.y); } @@ -173,7 +173,7 @@ bool operator ==(const Vector2& left, const Vector2& right) /// Operator != overload ; compares the difference of two vectors //////////////////////////////////////////////////////////// template -bool operator !=(const Vector2& left, const Vector2& right) +inline bool operator !=(const Vector2& left, const Vector2& right) { return (left.x != right.x) || (left.y != right.y); } diff --git a/include/SFML/System/Vector3.inl b/include/SFML/System/Vector3.inl index b26f574f..39f3dcf3 100644 --- a/include/SFML/System/Vector3.inl +++ b/include/SFML/System/Vector3.inl @@ -27,7 +27,7 @@ /// Default constructor //////////////////////////////////////////////////////////// template -Vector3::Vector3() : +inline Vector3::Vector3() : x(0), y(0), z(0) @@ -40,7 +40,7 @@ z(0) /// Construct the color from its coordinates //////////////////////////////////////////////////////////// template -Vector3::Vector3(T X, T Y, T Z) : +inline Vector3::Vector3(T X, T Y, T Z) : x(X), y(Y), z(Z) @@ -53,7 +53,7 @@ z(Z) /// Operator - overload ; returns the opposite of a vector //////////////////////////////////////////////////////////// template -Vector3 operator -(const Vector3& left) +inline Vector3 operator -(const Vector3& left) { return Vector3(-left.x, -left.y, -left.z); } @@ -63,7 +63,7 @@ Vector3 operator -(const Vector3& left) /// Operator += overload ; add two vectors and assign to the first op //////////////////////////////////////////////////////////// template -Vector3& operator +=(Vector3& left, const Vector3& right) +inline Vector3& operator +=(Vector3& left, const Vector3& right) { left.x += right.x; left.y += right.y; @@ -77,7 +77,7 @@ Vector3& operator +=(Vector3& left, const Vector3& right) /// Operator -= overload ; subtract two vectors and assign to the first op //////////////////////////////////////////////////////////// template -Vector3& operator -=(Vector3& left, const Vector3& right) +inline Vector3& operator -=(Vector3& left, const Vector3& right) { left.x -= right.x; left.y -= right.y; @@ -91,7 +91,7 @@ Vector3& operator -=(Vector3& left, const Vector3& right) /// Operator + overload ; adds two vectors //////////////////////////////////////////////////////////// template -Vector3 operator +(const Vector3& left, const Vector3& right) +inline Vector3 operator +(const Vector3& left, const Vector3& right) { return Vector3(left.x + right.x, left.y + right.y, left.z + right.z); } @@ -101,7 +101,7 @@ Vector3 operator +(const Vector3& left, const Vector3& right) /// Operator - overload ; subtracts two vectors //////////////////////////////////////////////////////////// template -Vector3 operator -(const Vector3& left, const Vector3& right) +inline Vector3 operator -(const Vector3& left, const Vector3& right) { return Vector3(left.x - right.x, left.y - right.y, left.z - right.z); } @@ -111,7 +111,7 @@ Vector3 operator -(const Vector3& left, const Vector3& right) /// Operator * overload ; multiply a vector by a scalar value //////////////////////////////////////////////////////////// template -Vector3 operator *(const Vector3& left, T right) +inline Vector3 operator *(const Vector3& left, T right) { return Vector3(left.x * right, left.y * right, left.z * right); } @@ -121,7 +121,7 @@ Vector3 operator *(const Vector3& left, T right) /// Operator * overload ; multiply a scalar value by a vector //////////////////////////////////////////////////////////// template -Vector3 operator *(T left, const Vector3& right) +inline Vector3 operator *(T left, const Vector3& right) { return Vector3(right.x * left, right.y * left, right.z * left); } @@ -131,7 +131,7 @@ Vector3 operator *(T left, const Vector3& right) /// Operator *= overload ; multiply-assign a vector by a scalar value //////////////////////////////////////////////////////////// template -Vector3& operator *=(Vector3& left, T right) +inline Vector3& operator *=(Vector3& left, T right) { left.x *= right; left.y *= right; @@ -145,7 +145,7 @@ Vector3& operator *=(Vector3& left, T right) /// Operator / overload ; divide a vector by a scalar value //////////////////////////////////////////////////////////// template -Vector3 operator /(const Vector3& left, T right) +inline Vector3 operator /(const Vector3& left, T right) { return Vector3(left.x / right, left.y / right, left.z / right); } @@ -155,7 +155,7 @@ Vector3 operator /(const Vector3& left, T right) /// Operator /= overload ; divide-assign a vector by a scalar value //////////////////////////////////////////////////////////// template -Vector3& operator /=(Vector3& left, T right) +inline Vector3& operator /=(Vector3& left, T right) { left.x /= right; left.y /= right; @@ -169,7 +169,7 @@ Vector3& operator /=(Vector3& left, T right) /// Operator == overload ; compares the equality of two vectors //////////////////////////////////////////////////////////// template -bool operator ==(const Vector3& left, const Vector3& right) +inline bool operator ==(const Vector3& left, const Vector3& right) { return (left.x == right.x) && (left.y == right.y) && (left.z == right.z); } @@ -179,7 +179,7 @@ bool operator ==(const Vector3& left, const Vector3& right) /// Operator != overload ; compares the difference of two vectors //////////////////////////////////////////////////////////// template -bool operator !=(const Vector3& left, const Vector3& right) +inline bool operator !=(const Vector3& left, const Vector3& right) { return (left.x != right.x) || (left.y != right.y) || (left.z != right.z); }