diff --git a/src/vector.hpp b/src/vector.hpp index 87ae4f8..f095ac4 100644 --- a/src/vector.hpp +++ b/src/vector.hpp @@ -49,13 +49,13 @@ namespace cloonel { }; template - Vector::type, S> operator+ ( const Vector& parA, const Vector& parB ) __attribute__((pure)); + Vector::type, S> operator+ ( Vector parA, const Vector& parB ) __attribute__((pure)); template - Vector::type, S> operator- ( const Vector& parA, const Vector& parB ) __attribute__((pure)); + Vector::type, S> operator- ( Vector parA, const Vector& parB ) __attribute__((pure)); template - Vector::type, S> operator* ( const Vector& parA, const Vector& parB ) __attribute__((pure)); + Vector::type, S> operator* ( Vector parA, const Vector& parB ) __attribute__((pure)); template - Vector::type, S> operator/ ( const Vector& parA, const Vector& parB ) __attribute__((pure)); + Vector::type, S> operator/ ( Vector parA, const Vector& parB ) __attribute__((pure)); template Vector::type, S> operator+ ( U parA, const Vector& parB ) __attribute__((pure)); template diff --git a/src/vector.inl b/src/vector.inl index a6b010e..c6ec36c 100644 --- a/src/vector.inl +++ b/src/vector.inl @@ -91,35 +91,27 @@ namespace cloonel { ///------------------------------------------------------------------------- template inline - Vector::type, S> operator+ (const Vector& parA, const Vector& parB) { - typedef typename std::common_type::type RetType; - Vector retVal(parA); + Vector::type, S> operator+ (Vector parA, const Vector& parB) { parA += parB; - return retVal; + return parA; } template inline - Vector::type, S> operator- (const Vector& parA, const Vector& parB) { - typedef typename std::common_type::type RetType; - Vector retVal(parA); + Vector::type, S> operator- (Vector parA, const Vector& parB) { parA -= parB; - return retVal; + return parA; } template inline - Vector::type, S> operator* (const Vector& parA, const Vector& parB) { - typedef typename std::common_type::type RetType; - Vector retVal(parA); + Vector::type, S> operator* (Vector parA, const Vector& parB) { parA *= parB; - return retVal; + return parA; } template inline - Vector::type, S> operator/ (const Vector& parA, const Vector& parB) { - typedef typename std::common_type::type RetType; - Vector retVal(parA); + Vector::type, S> operator/ (Vector parA, const Vector& parB) { parA /= parB; - return retVal; + return parA; } ///-------------------------------------------------------------------------