fork(4) download
  1. #include <iostream>
  2. #include <set>
  3. #include <algorithm>
  4. using namespace std;
  5. struct node{
  6. int x;
  7. int y;
  8. };
  9. inline bool operator<(const node& a, const node& b){
  10. if(a.x!=b.x)
  11. return a.x< b.x;
  12. else
  13. return a.y<b.y;
  14. }
  15. multiset<node> mset;
  16. int main() {
  17. node b=node();
  18. b={1,2};
  19. mset.insert({1,2});
  20. mset.erase(b);
  21. cout<<mset.size()<<endl;
  22. cout<<b.y;
  23. return 0;
  24. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
0
2