C++ 为多重映射创建迭代器
我有这个密码C++ 为多重映射创建迭代器,c++,iterator,multimap,C++,Iterator,Multimap,我有这个密码 class Iterator{ private: MultiMap mp; int curent; public: Iterator(MultiMap md):mp(md),curent(0){}; }; class MultiMap{ private: int m; int urm[20]; public: Iterator begin(){return Iterator();/*here is the probleme*/}; }; 如何为begi
class Iterator{
private:
MultiMap mp;
int curent;
public:
Iterator(MultiMap md):mp(md),curent(0){};
};
class MultiMap{
private:
int m;
int urm[20];
public:
Iterator begin(){return Iterator();/*here is the probleme*/};
};
如何为begin from类MultiMap创建迭代器?
我应该如何从方法begin调用迭代器创建者?提示:
Iterator
将MultiMap
作为参数。我知道,但是,如何使用我的类作为参数?使用this
指针。谢谢,所以我更改了,从Iterator
private:MultiMap*mp
;