1 namespace AStuff{ 2 template<typename T> 3 class A 4 { 5 public: 6 void swap(A *other) 7 { 8 using std::swap; 9 swap(pImpl,other.plmpl); 10 } 11 private: 12 AImpl *pImpl; 13 }; 14 template<typename T> 15 void swap(A<T> &a,A<T>&b) 16 { 17 a.swap(b); 18 } 19 } 20 21 template<typename T> 22 void dosomething(T &a,T&b) 23 { 24 using std::swap; 25 swap(a,b); 26 }