1 // Boost.Geometry Index
3 // Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
5 // Use, modification and distribution is subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP
10 #define BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP
12 #include <boost/core/no_exceptions_support.hpp>
14 #ifndef BOOST_NO_EXCEPTIONS
16 #include <boost/throw_exception.hpp>
19 #include <boost/geometry/index/detail/assert.hpp>
22 namespace boost { namespace geometry { namespace index { namespace detail {
24 #ifndef BOOST_NO_EXCEPTIONS
26 inline void throw_runtime_error(const char * str)
28 BOOST_THROW_EXCEPTION(std::runtime_error(str));
31 inline void throw_logic_error(const char * str)
33 BOOST_THROW_EXCEPTION(std::logic_error(str));
36 inline void throw_invalid_argument(const char * str)
38 BOOST_THROW_EXCEPTION(std::invalid_argument(str));
41 inline void throw_length_error(const char * str)
43 BOOST_THROW_EXCEPTION(std::length_error(str));
46 inline void throw_out_of_range(const char * str)
48 BOOST_THROW_EXCEPTION(std::out_of_range(str));
53 inline void throw_runtime_error(const char * str)
55 BOOST_GEOMETRY_INDEX_ASSERT(!"runtime_error thrown", str);
59 inline void throw_logic_error(const char * str)
61 BOOST_GEOMETRY_INDEX_ASSERT(!"logic_error thrown", str);
65 inline void throw_invalid_argument(const char * str)
67 BOOST_GEOMETRY_INDEX_ASSERT(!"invalid_argument thrown", str);
71 inline void throw_length_error(const char * str)
73 BOOST_GEOMETRY_INDEX_ASSERT(!"length_error thrown", str);
77 inline void throw_out_of_range(const char * str)
79 BOOST_GEOMETRY_INDEX_ASSERT(!"out_of_range thrown", str);
85 }}}} // namespace boost::geometry::index::detail
87 #endif // BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP