C++ operator overloading adding 3 vectors together
问题 For now this is how I add 3 vectors of type Product together: vector1.insert(std::end(vector1), std::begin(vector2), std::end(vector2)); vector1.insert(std::end(vector1), std::begin(vector3), std::end(vector3)); How do I use operator overloading (I assume overloading the + and = operators) to simplify my code? Product has the following properties: private: std::string url; double cost; std::string name; std::string site; 回答1: Operating overloading is just a normal free function, or member