mv the raw pointer {swap,replace}_ptr to std::ptr