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

Module - m23.html

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

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

// Item 23: Prefer non-member non-friend functions to member functions. 98

#include "m23.h"
class Browser {
public:
	void clear();
	// ...
};



Function Name: clear()

void Browser::clear() {
}
void clear( Browser & b )



Function Name: clear()

{
	b.clear();
}

// namespace solution in source follows

namespace BrowserNS {
class Browser {
public:
	void clear();
	// ...
};
void clear(Browser&b)



Function Name: clear()

{
	b.clear();
}
}	// end of namespace
class Browser {
public:
	 friend void clearall();
};

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

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