diff options
Diffstat (limited to 'boost/geometry/index/detail/exception.hpp')
-rw-r--r-- | boost/geometry/index/detail/exception.hpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/boost/geometry/index/detail/exception.hpp b/boost/geometry/index/detail/exception.hpp index c3ea0e1923..e2090533e7 100644 --- a/boost/geometry/index/detail/exception.hpp +++ b/boost/geometry/index/detail/exception.hpp @@ -1,6 +1,6 @@ // Boost.Geometry Index // -// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland. // // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -9,10 +9,14 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP +#include <boost/core/no_exceptions_support.hpp> + #ifndef BOOST_NO_EXCEPTIONS #include <stdexcept> +#include <boost/throw_exception.hpp> #else #include <cstdlib> +#include <boost/geometry/index/detail/assert.hpp> #endif namespace boost { namespace geometry { namespace index { namespace detail { @@ -21,47 +25,58 @@ namespace boost { namespace geometry { namespace index { namespace detail { inline void throw_runtime_error(const char * str) { - throw std::runtime_error(str); + BOOST_THROW_EXCEPTION(std::runtime_error(str)); } inline void throw_logic_error(const char * str) { - throw std::logic_error(str); + BOOST_THROW_EXCEPTION(std::logic_error(str)); } inline void throw_invalid_argument(const char * str) { - throw std::invalid_argument(str); + BOOST_THROW_EXCEPTION(std::invalid_argument(str)); } inline void throw_length_error(const char * str) { - throw std::length_error(str); + BOOST_THROW_EXCEPTION(std::length_error(str)); +} + +inline void throw_out_of_range(const char * str) +{ + BOOST_THROW_EXCEPTION(std::out_of_range(str)); } #else inline void throw_runtime_error(const char * str) { - BOOST_ASSERT_MSG(!"runtime_error thrown", str); + BOOST_GEOMETRY_INDEX_ASSERT(!"runtime_error thrown", str); std::abort(); } inline void throw_logic_error(const char * str) { - BOOST_ASSERT_MSG(!"logic_error thrown", str); + BOOST_GEOMETRY_INDEX_ASSERT(!"logic_error thrown", str); std::abort(); } inline void throw_invalid_argument(const char * str) { - BOOST_ASSERT_MSG(!"invalid_argument thrown", str); + BOOST_GEOMETRY_INDEX_ASSERT(!"invalid_argument thrown", str); std::abort(); } inline void throw_length_error(const char * str) { - BOOST_ASSERT_MSG(!"length_error thrown", str); + BOOST_GEOMETRY_INDEX_ASSERT(!"length_error thrown", str); + std::abort(); +} + +inline void throw_out_of_range(const char * str) +{ + BOOST_GEOMETRY_INDEX_ASSERT(!"out_of_range thrown", str); std::abort(); } |