assert.hpp
Go to the documentation of this file.
00001 //
00002 //  boost/assert.hpp - BOOST_ASSERT(expr)
00003 //
00004 //  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
00005 //  Copyright (c) 2007 Peter Dimov
00006 //
00007 // Distributed under the Boost Software License, Version 1.0. (See
00008 // accompanying file LICENSE_1_0.txt or copy at
00009 // http://www.boost.org/LICENSE_1_0.txt)
00010 //
00011 //  Note: There are no include guards. This is intentional.
00012 //
00013 //  See http://www.boost.org/libs/utility/assert.html for documentation.
00014 //
00015 
00016 #undef BOOST_ASSERT
00017 
00018 #if defined(BOOST_DISABLE_ASSERTS)
00019 
00020 # define BOOST_ASSERT(expr) ((void)0)
00021 
00022 #elif defined(BOOST_ENABLE_ASSERT_HANDLER)
00023 
00024 #include <boost/current_function.hpp>
00025 
00026 namespace boost
00027 {
00028 
00029 void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
00030 
00031 } // namespace boost
00032 
00033 #define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
00034 
00035 #else
00036 # include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
00037 # define BOOST_ASSERT(expr) assert(expr)
00038 #endif
00039 
00040 #undef BOOST_VERIFY
00041 
00042 #if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )
00043 
00044 # define BOOST_VERIFY(expr) ((void)(expr))
00045 
00046 #else
00047 
00048 # define BOOST_VERIFY(expr) BOOST_ASSERT(expr)
00049 
00050 #endif


appl
Author(s): petercai
autogenerated on Tue Jan 7 2014 11:02:28