What is the difference between them?

Revision en5, by Halym2007, 2024-01-28 20:15:14

both code did same.what is the difference?

First one : 
set <int> s;
s.insert (1);s.insert (3);s.insert (5);
auto tr = s.lower_bound (2);
s.erase (tr);<-----------here
--------------------------
Second one : 
set <int> s;
s.insert (1);s.insert (3);s.insert (5);
auto tr = s.lower_bound (2);
s.erase (*tr);<-----------here

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English Halym2007 2024-01-28 20:15:14 0 (published)
en4 English Halym2007 2024-01-28 20:15:05 4 Tiny change: 'ference?\n~~~~~\nF' -> 'ference?\n\n\n~~~~~\nF' (saved to drafts)
en3 English Halym2007 2024-01-28 20:14:48 77 (published)
en2 English Halym2007 2024-01-28 20:13:34 79
en1 English Halym2007 2024-01-28 20:12:29 282 Initial revision (saved to drafts)