#include <iostream>
class CVector {
public:
int x, y;
CVector() {};
CVector(int a, int b) :x(a), y(b) {
std::cout<<"paremterized ctor used"<<std::endl;
}
};
CVector operator- (const CVector& lhs, const CVector& rhs)
{
return CVector(lhs.x - rhs.x, lhs.y - rhs.y); //this uses the parameterized ctor
}
int main()
{
CVector foo(2, 3);
CVector bar(3, 2);
CVector result;
result = foo - bar;
std::cout << result.x << ',' << result.y << std::endl;
}