// Copyright 2005 Rutger E.W. van Beusekom.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef _ERROR_HANDLING_HPP_
#define _ERROR_HANDLING_HPP_

#include <stdexcept>

#define __AT__ __FILE__ ":" STRINGIZE(__LINE__) ": "
#define STRINGIZE(x) STRINGIZE_(x)
#define STRINGIZE_(x) #x

#ifndef NDEBUG
#define throw_assert(expr) if(!(expr))\
{ throw std::logic_error("\n"__AT__ "invariant: " #expr " not upheld"); }
#else
#define throw_assert(expr)
#endif

#endif
