Below is my code. The include directives and the using std::* declarations have been removed for brevity:
class HasPtr {
friend void swap(HasPtr&, HasPtr&);
public:
HasPtr(const std::string &s = string()): ps(new string(s)), i(0) {}
HasPtr(const string &s, const int &j) : ps(new...