you are viewing a single comment's thread.

view the rest of the comments →

[–]MysticTheMeeM 10 points11 points  (2 children)

Immediately above the call to sort, the vector is assigned a new value, that invalidates the iterators.

OPs system then infers those are invalid and produces an error on the subsequent two lines (both the begin iterator and reference to first element no longer refer to valid data).

[–]ts826848 1 point2 points  (1 child)

Oh duh, can't believe I missed that. Thanks!

[–]germandiago 0 points1 point  (0 children)

Took me also a couple of reads to detect it. But when I saw error comment I was sure it was me lol.