Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Can this be refined?
- template<class T> class Vector2
- {
- public:
- T x, y;
- Vector2(T cx, T cy)
- {
- x = cx;
- y = cy;
- }
- Vector2 operator+(Vector2 rhs)
- {
- decltype(rhs) temp(0, 0);
- temp.x = this->x + rhs.x;
- temp.y = this->y + rhs.y;
- return temp;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment