Get last/newly added element in std::set

Posted by Dave17 on Stack Overflow See other posts from Stack Overflow or by Dave17
Published on 2010-03-08T18:33:17Z Indexed on 2010/03/08 18:36 UTC
Read the original article Hit count: 153

Filed under:
|

can you get the last or newly added element in std::set? for example say if the loop runs to collect the elements to fill in the std::set.

if on the first run the set was,

[0] "A"
[1] "B"
[2] "D"

and, on second run, the set becomes

[0] "A"
[1] "B"
[2] "C"
[3] "D"

How would you check if 'C' is the new element that was added?

© Stack Overflow or respective owner

Related posts about c++

Related posts about stl