Why for(auto x:st)st.erase(st.find(x)); and for( it=st.begin();it!=st.end();it++)st.erase(it); causes runtime error??
# | User | Rating |
---|---|---|
1 | tourist | 3757 |
2 | jiangly | 3647 |
3 | Benq | 3581 |
4 | orzdevinwang | 3570 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | Radewoosh | 3509 |
8 | ecnerwala | 3486 |
9 | jqdai0815 | 3474 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 171 |
2 | awoo | 164 |
2 | adamant | 164 |
4 | TheScrasse | 159 |
5 | nor | 154 |
5 | maroonrk | 154 |
7 | -is-this-fft- | 152 |
8 | Petr | 147 |
9 | orz | 146 |
10 | pajenegod | 145 |
Runtime error in set.erase() ?
Why for(auto x:st)st.erase(st.find(x)); and for( it=st.begin();it!=st.end();it++)st.erase(it); causes runtime error??
Rev. | Lang. | By | When | Δ | Comment | |
---|---|---|---|---|---|---|
en3 | RED_in_Three_Months | 2019-10-12 00:31:48 | 0 | (published) | ||
en2 | RED_in_Three_Months | 2019-10-12 00:30:24 | 20 | Tiny change: ' \nfor(set<int> :: i' -> ' \nfor(set <int> :: i' (saved to drafts) | ||
en1 | RED_in_Three_Months | 2019-10-12 00:24:15 | 171 | Initial revision (published) |
Name |
---|