I am looking for the most effective way to exchange v[i] and v[j], and expected to find something like v.swap(i, j) but it doesn't seem to exist. Is there anything better than v[i], v[j] = v[j], v[i] (which I don't like particularly because it evaluates each of v[i] and v[j] twice)?