Abraxas/Meyers: Effective C++  Home  Table of Contents

Module - m25.html

ABRAXAS SOFTWARE - CodeCheck Meyers: Effective C++ Test-Suite

Meyers: Effective C++ Test Suite for Module - m25.cpp

// Item 25: Consider support for a non-throwing swap. 106

namespace std {

// ... overloading std ... rule 25

	class C;
	void swap( C&, C& );	// dummy
}
	class Widget {
	public:
		void swap ( Widget & other )		// rule 25
		}



Function Name: swap()

		{
	};
namespace nsWidget {
	using std::swap;	//ok
	template  
	class Widget  ;	// ok
	template  
	void swap( Widget&a, Widget&b )	// ok



Function Name: swap()

	{
		s.swap(b); // ok
	}
};

Abraxas/Meyers: Effective C++  Home  Table of Contents

ABRAXAS SOFTWARE - CodeCheck Meyers: Effective C++ Test-Suite