+++ /dev/null
-// Macro Guard\r
-#ifndef CSE473_ASSERTIONS_H\r
-#define CSE473_ASSERTIONS_H\r
-\r
-// Files included\r
-#include "StandardFiles.h"\r
-\r
-\r
-/*============================================================================//\r
- Assertion.h: header file for Assert<ExceptionType> UDT\r
-\r
- Purpose is mostly syntactic sugar. This class allows for runtime assertions\r
- to be made.\r
-\r
- Implementation: Shane J. Neph, June 2004, University of Washington\r
-//============================================================================*/\r
-\r
-\r
-template <typename ExceptionType>\r
-struct Assert {\r
- explicit Assert(bool toAssert) {\r
- if ( ! toAssert ) {\r
- ExceptionType exc;\r
- throw(exc);\r
- }\r
- } // Assert(Overload1)\r
- \r
- Assert(bool toAssert, const std::string& info) {\r
- if ( ! toAssert ) \r
- throw(ExceptionType(info));\r
- } // Assert(Overload2)\r
-\r
- Assert(bool toAssert, const std::string& info1, const std::string& info2) {\r
- if ( ! toAssert )\r
- throw(ExceptionType(info1, info2));\r
- } // Assert(Overload3)\r
-};\r
-\r
-\r
-#endif // CSE473_ASSERTIONS_H\r