Original Post
template<typename T> inline vec2<T> operator *(const vec2<T>& lhs, const vec2<T>& rhs)
{
return vec2<T>(lhs.x * rhs.x, lhs.y * rhs.y);
}
result = pos * posa;
template<typename T> inline vec2<T> operator *(const vec2<T>& lhs, const vec2<T>& rhs)
{
return vec2<T>(lhs.x * rhs.x, lhs.y * rhs.y);
}
result = pos * posa;
template<typename T> class vec2 {public: friend inline vec2 operator *(const vec2& lhs, const vec2& rhs) { return vec2(lhs.x * rhs.x, lhs.y * rhs.y); } };This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more