这是我的代码...
class Obj
{
public :
int iNum = 100;
};
map<string, tuple<int,Obj*>> maplist;
auto pObj = new Obj();
auto pObj1 = new Obj();
maplist["hi"] = make_tuple( 100, pObj );
cout << maplist["hi"].first << endl; // Error !
cout << maplist["hi"].second << endl; // Error !
错误消息:E0135没有成员
我要编程属性(.first,.second,third ...)。如何操作符重载?我该怎么办?地图中有[] operator吗?或在元组中添加属性?