00001 #ifndef _theplu_yat_utility_yat_assert_ 00002 #define _theplu_yat_utility_yat_assert_ 00003 // $Id: yat_assert.h 1797 2009-02-12 18:07:10Z peter $ 00004 00005 /* 00006 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 00007 00008 This file is part of the yat library, http://dev.thep.lu.se/yat 00009 00010 The yat library is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU General Public License as 00012 published by the Free Software Foundation; either version 3 of the 00013 License, or (at your option) any later version. 00014 00015 The yat library is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with yat. If not, see <http://www.gnu.org/licenses/>. 00022 */ 00023 00024 #include <string> 00025 00026 namespace theplu { 00027 namespace yat { 00028 namespace utility { 00029 00038 template<class X> inline void yat_assert(bool assertion, std::string msg="") 00039 #ifdef YAT_DEBUG 00040 { if (!assertion) throw X(std::string("yat_assert:")+msg); } 00041 #else 00042 { } 00043 #endif 00044 00045 }}} 00046 /* 00047 */ 00048 #endif