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

Module - m08.html

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

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

// Item 8: Prevent exceptions from leaving destructors. 44

class Widget {
public:
	Widget();
	~Widget();
private:
	bool closed;
};



Function Name: Widget()

Widget::~Widget() {
	
	if ( closed  ) {
		try {
			Widget();
		}
		catch( ... ) {
			throw;		// rule 8
		}
	}
}

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

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