There is a generic `std::swap` function that does accomplish this in one line:
`std::swap(select, oldselect);`