Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Simple{
- private:
- int m_nID;
- public:
- Simple(int nID) {m_nID = nID};
- ~Simple() {}
- Simple(const Simple &other){ m_nID = other.m_nID; }
- int getid(){return m_nID;}
- };
- int main ()
- {
- std::map<int,Simple> myMap;
- Simple s1(1);
- Simple s2(2);
- myMap.insert(std::make_pair(1, s1));
- myMap[2]=s2;// this doesn't work
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement