Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class Simple{
  2.  
  3. private:
  4. int m_nID;
  5.  
  6. public:
  7. Simple(int nID) {m_nID = nID};
  8. ~Simple() {}
  9.  
  10. Simple(const Simple &other){ m_nID = other.m_nID; }
  11. int getid(){return m_nID;}
  12. };
  13.  
  14. int main ()
  15. {
  16. std::map<int,Simple> myMap;
  17.  
  18. Simple s1(1);
  19. Simple s2(2);
  20. myMap.insert(std::make_pair(1, s1));
  21. myMap[2]=s2;// this doesn't work
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement