SUMO - Simulation of Urban MObility
static_assert.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 // vim:tabstop=4:shiftwidth=4:expandtab:
00003 #ifdef _MSC_VER
00004 #include <windows_config.h>
00005 #else
00006 #include <config.h>
00007 #endif
00008 #ifdef CHECK_MEMORY_LEAKS
00009 /*
00010  * Copyright (C) 2004-2008 Wu Yongwei <adah at users dot sourceforge dot net>
00011  *
00012  * This software is provided 'as-is', without any express or implied
00013  * warranty.  In no event will the authors be held liable for any
00014  * damages arising from the use of this software.
00015  *
00016  * Permission is granted to anyone to use this software for any purpose,
00017  * including commercial applications, and to alter it and redistribute
00018  * it freely, subject to the following restrictions:
00019  *
00020  * 1. The origin of this software must not be misrepresented; you must
00021  *    not claim that you wrote the original software.  If you use this
00022  *    software in a product, an acknowledgement in the product
00023  *    documentation would be appreciated but is not required.
00024  * 2. Altered source versions must be plainly marked as such, and must
00025  *    not be misrepresented as being the original software.
00026  * 3. This notice may not be removed or altered from any source
00027  *    distribution.
00028  *
00029  * This file is part of Stones of Nvwa:
00030  *      http://sourceforge.net/projects/nvwa
00031  *
00032  */
00033 
00044 #ifndef STATIC_ASSERT
00045 
00046 template <bool> struct __nvwa_compile_time_error;
00047 template <>     struct __nvwa_compile_time_error<true> {};
00048 
00049 #define STATIC_ASSERT(_Expr, _Msg) \
00050     { \
00051         __nvwa_compile_time_error<((_Expr) != 0)> ERROR_##_Msg; \
00052         (void)ERROR_##_Msg; \
00053     }
00054 
00055 #endif // STATIC_ASSERT
00056 
00057 
00058 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines