Commit | Line | Data |
---|---|---|
780b0bca CH |
1 | // Boost assertion handler |
2 | // | |
3 | // Defines boost::assertion_failed which is declared in <boost/assert.hpp> but | |
4 | // not defined to be overwritten by user | |
5 | // | |
6 | // created 2014 by Christian Herdtweck, Intra2net AG | |
7 | // | |
8 | // Distributed under the Boost Software License, Version 1.0. | |
9 | // (See accompanying file LICENSE_1_0.txt or copy at | |
10 | // http://www.boost.org/LICENSE_1_0.txt) | |
11 | ||
12 | #include <stdexcept> | |
13 | #include <sstream> | |
14 | #include "boost_assert_handler.h" | |
15 | ||
16 | namespace boost | |
17 | { | |
18 | void assertion_failed(char const * expr, char const * function, | |
19 | char const * file, long line) | |
20 | { | |
21 | std::stringstream msg; | |
22 | msg << "BOOST_ASSERT( " << expr << " ) failed for function " | |
23 | << function << " (line " << line << ")!"; | |
24 | throw std::runtime_error( msg.str() ); | |
25 | } | |
26 | } |