标签: c++
我正在努力使用以下代码。声明this->oEvent = oEvent;是否会复制或引用oEvent?
this->oEvent = oEvent;
class Test { private: map<string, string> oEvent; public: run( map<string, string> &oEvent ) { this->oEvent = oEvent; } };
答案 0 :(得分:1)
它会复制,因为Test::oEvent不是参考。
Test::oEvent