Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个对向量的自动引用:
auto &myVector = solution->myVector;
其中 solution->myVector 是公共成员,是一些对象的向量。
如果我稍后在代码中执行此操作:
myVector = someOtherVector;
解决方案-> myVector 会改变吗?
谢谢
是的。这将调用myVector.operator=()which 实际上是solution->myVector.operator=().
myVector.operator=()
solution->myVector.operator=()
是的,当然,如果公共成员是int.
int