annotate DEPENDENCIES/generic/include/boost/geometry/index/detail/exception.hpp @ 46:d572322e2efe

Fix to .cat file check (was susceptible to DOS line-endings) and subrepo update
author Chris Cannam
date Thu, 07 Aug 2014 14:39:38 +0100
parents 2665513ce2d3
children c530137014c0
rev   line source
Chris@16 1 // Boost.Geometry Index
Chris@16 2 //
Chris@16 3 // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
Chris@16 4 //
Chris@16 5 // Use, modification and distribution is subject to the Boost Software License,
Chris@16 6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 7 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 8
Chris@16 9 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP
Chris@16 10 #define BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP
Chris@16 11
Chris@16 12 #ifndef BOOST_NO_EXCEPTIONS
Chris@16 13 #include <stdexcept>
Chris@16 14 #else
Chris@16 15 #include <cstdlib>
Chris@16 16 #endif
Chris@16 17
Chris@16 18 namespace boost { namespace geometry { namespace index { namespace detail {
Chris@16 19
Chris@16 20 #ifndef BOOST_NO_EXCEPTIONS
Chris@16 21
Chris@16 22 inline void throw_runtime_error(const char * str)
Chris@16 23 {
Chris@16 24 throw std::runtime_error(str);
Chris@16 25 }
Chris@16 26
Chris@16 27 inline void throw_logic_error(const char * str)
Chris@16 28 {
Chris@16 29 throw std::logic_error(str);
Chris@16 30 }
Chris@16 31
Chris@16 32 inline void throw_invalid_argument(const char * str)
Chris@16 33 {
Chris@16 34 throw std::invalid_argument(str);
Chris@16 35 }
Chris@16 36
Chris@16 37 inline void throw_length_error(const char * str)
Chris@16 38 {
Chris@16 39 throw std::length_error(str);
Chris@16 40 }
Chris@16 41
Chris@16 42 #else
Chris@16 43
Chris@16 44 inline void throw_runtime_error(const char * str)
Chris@16 45 {
Chris@16 46 BOOST_ASSERT_MSG(!"runtime_error thrown", str);
Chris@16 47 std::abort();
Chris@16 48 }
Chris@16 49
Chris@16 50 inline void throw_logic_error(const char * str)
Chris@16 51 {
Chris@16 52 BOOST_ASSERT_MSG(!"logic_error thrown", str);
Chris@16 53 std::abort();
Chris@16 54 }
Chris@16 55
Chris@16 56 inline void throw_invalid_argument(const char * str)
Chris@16 57 {
Chris@16 58 BOOST_ASSERT_MSG(!"invalid_argument thrown", str);
Chris@16 59 std::abort();
Chris@16 60 }
Chris@16 61
Chris@16 62 inline void throw_length_error(const char * str)
Chris@16 63 {
Chris@16 64 BOOST_ASSERT_MSG(!"length_error thrown", str);
Chris@16 65 std::abort();
Chris@16 66 }
Chris@16 67
Chris@16 68 #endif
Chris@16 69
Chris@16 70 }}}} // namespace boost::geometry::index::detail
Chris@16 71
Chris@16 72 #endif // BOOST_GEOMETRY_INDEX_DETAIL_EXCEPTION_HPP