Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:32

0001 // Boost.Geometry Index
0002 //
0003 // Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
0004 //
0005 // Use, modification and distribution is subject to the Boost Software License,
0006 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP
0010 #define BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP
0011 
0012 #include <boost/core/no_exceptions_support.hpp>
0013 
0014 #ifndef BOOST_NO_EXCEPTIONS
0015 #include <stdexcept>
0016 #include <boost/throw_exception.hpp>
0017 #else
0018 #include <cstdlib>
0019 #include <boost/geometry/index/detail/assert.hpp>
0020 #endif
0021 
0022 namespace boost { namespace geometry { namespace index { namespace detail {
0023 
0024 #ifndef BOOST_NO_EXCEPTIONS
0025 
0026 inline void throw_runtime_error(const char * str)
0027 {
0028     BOOST_THROW_EXCEPTION(std::runtime_error(str));
0029 }
0030 
0031 inline void throw_logic_error(const char * str)
0032 {
0033     BOOST_THROW_EXCEPTION(std::logic_error(str));
0034 }
0035 
0036 inline void throw_invalid_argument(const char * str)
0037 {
0038     BOOST_THROW_EXCEPTION(std::invalid_argument(str));
0039 }
0040 
0041 inline void throw_length_error(const char * str)
0042 {
0043     BOOST_THROW_EXCEPTION(std::length_error(str));
0044 }
0045 
0046 inline void throw_out_of_range(const char * str)
0047 {
0048     BOOST_THROW_EXCEPTION(std::out_of_range(str));
0049 }
0050 
0051 #else
0052 
0053 inline void throw_runtime_error(const char * str)
0054 {
0055     BOOST_GEOMETRY_INDEX_ASSERT(!"runtime_error thrown", str);
0056     std::abort();
0057 }
0058 
0059 inline void throw_logic_error(const char * str)
0060 {
0061     BOOST_GEOMETRY_INDEX_ASSERT(!"logic_error thrown", str);
0062     std::abort();
0063 }
0064 
0065 inline void throw_invalid_argument(const char * str)
0066 {
0067     BOOST_GEOMETRY_INDEX_ASSERT(!"invalid_argument thrown", str);
0068     std::abort();
0069 }
0070 
0071 inline void throw_length_error(const char * str)
0072 {
0073     BOOST_GEOMETRY_INDEX_ASSERT(!"length_error thrown", str);
0074     std::abort();
0075 }
0076 
0077 inline void throw_out_of_range(const char * str)
0078 {
0079     BOOST_GEOMETRY_INDEX_ASSERT(!"out_of_range thrown", str);
0080     std::abort();
0081 }
0082 
0083 #endif
0084 
0085 }}}} // namespace boost::geometry::index::detail
0086 
0087 #endif // BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP