Quick question (hopefully). I have a vector of strings and need to remove duplicates. Normally, I'd just use sort, erase and unique. However, I don't want to sort the data. My idea was to copy the vector to a set, then back to a vector. But every attempt just screws up the order. My last attempt involved copying the vector to a set, copying the set to another vector by using back_insert, and then reversing the vector. Doesn't work. I'd appreciate any ideas on how to solve this. Thanks. Here's the last attempt:
copy(v.begin(), v.end(), inserter(s, s.end()));
copy(s.begin(),s.end(), back_inserter(newV));
reverse(newV.begin(),newV.end());