use generic swap for complex numbers