Let's sort a vector
of 1 million of strings with:
std::vector<std::wstring> v;
// fill the vector
std::sort(v.begin(), v.end());
Does it:
- rewrite the vector with new
wstring
s, containing a few bytes for thewstring
structure itself + a pointer to the unmodified actual raw data, without rewriting / moving the actual characters raw data
or
- rewrite the vector with new
wstring
s and the actual characters raw data is also rewritten / moved?
If the strings are, say, 100 character-long on average, I can imagine that 2. would be considerably slower than 1.
Which of these 2 situations is true on C++03 ? On C++11?
Aucun commentaire:
Enregistrer un commentaire