use custom swap() and avoid std::swap calling move ctor (recursion)
custom swap method
out-of-class swap method to be consistent