enforce same value type to use swap in assign_swap