C++的特性。比如string可以进行+=,=等操作来对字符串赋值,是因为他对运算符进行了重载。
一些资料:
https://www.cnblogs.com/xiaolincoding/p/11967842.html 【C++ 赋值运算符'='的重载(浅拷贝、深拷贝)】
https://www.runoob.com/cplusplus/assignment-operators-overloading.html 【菜鸟教程:C++ 赋值运算符重载】