Given that you implemented this as a vector of vectors, you can use a simple exchange:
std::swap(Qe[2], Qe[3]);
This should be of constant complexity. Of course, this will depend on whether you are treating your data as columns or rows. However, if you frequently swap columns, you will need to arrange the data accordingly (that is, for the code above to work).
for, ( ++), for ( , ), :
std::for_each(Qe.begin(), Qe.end(), [](std::vector<double> &v) {std::swap(v[2], v[3]); });
, - for . for :
for (auto &v : Qe)
std::swap(v[2], v[3]);
... std::for_each, ++ 11 for , , , std::for_each , (IOW, std::for_each ).