From 408fcbc548a31654b142b06dc1d1d16862499cb3 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Mon, 28 Aug 2023 12:51:06 +0300 Subject: [PATCH] Modernize noexcept specifications --- include/boost/geometry/algorithms/centroid.hpp | 2 +- .../geometry/algorithms/detail/has_self_intersections.hpp | 2 +- .../geometry/algorithms/detail/overlay/get_turn_info.hpp | 4 ++-- .../detail/overlay/inconsistent_turns_exception.hpp | 4 ++-- include/boost/geometry/core/exception.hpp | 8 ++++---- .../boost/geometry/extensions/gis/io/shapefile/read.hpp | 2 +- .../geometry/extensions/gis/io/shapelib/shape_creator.hpp | 2 +- .../geometry/extensions/gis/io/wkb/detail/parser.hpp | 2 +- include/boost/geometry/io/wkt/read.hpp | 4 ++-- include/boost/geometry/srs/projections/exception.hpp | 2 +- include/boost/geometry/srs/projections/str_cast.hpp | 2 +- index/test/rtree/exceptions/test_throwing.hpp | 4 ++-- index/test/rtree/exceptions/test_throwing_node.hpp | 2 +- test/core/assert.cpp | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp index 9559f06b92..bcf4dd0e8d 100644 --- a/include/boost/geometry/algorithms/centroid.hpp +++ b/include/boost/geometry/algorithms/centroid.hpp @@ -91,7 +91,7 @@ class centroid_exception : public geometry::exception \brief Returns the explanatory string. \return Pointer to a null-terminated string with explanatory information. */ - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Boost.Geometry Centroid calculation exception"; } diff --git a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp index 0b13eb7bda..49658ea2e0 100644 --- a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp +++ b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp @@ -53,7 +53,7 @@ class overlay_invalid_input_exception : public geometry::exception inline overlay_invalid_input_exception() {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Boost.Geometry Overlay invalid input exception"; } diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 4e10c07bde..80c4ae2d38 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -46,10 +46,10 @@ class turn_info_exception : public geometry::exception message += method; } - virtual ~turn_info_exception() throw() + virtual ~turn_info_exception() {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { return message.c_str(); } diff --git a/include/boost/geometry/algorithms/detail/overlay/inconsistent_turns_exception.hpp b/include/boost/geometry/algorithms/detail/overlay/inconsistent_turns_exception.hpp index 1486f94fbd..2782a8bc2c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/inconsistent_turns_exception.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/inconsistent_turns_exception.hpp @@ -22,10 +22,10 @@ class inconsistent_turns_exception : public geometry::exception inline inconsistent_turns_exception() {} - virtual ~inconsistent_turns_exception() throw() + virtual ~inconsistent_turns_exception() {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Boost.Geometry Inconsistent Turns exception"; } diff --git a/include/boost/geometry/core/exception.hpp b/include/boost/geometry/core/exception.hpp index 72bc598b2a..a81af0bce2 100644 --- a/include/boost/geometry/core/exception.hpp +++ b/include/boost/geometry/core/exception.hpp @@ -33,7 +33,7 @@ namespace boost { namespace geometry class exception : public std::exception { public: - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Boost.Geometry exception"; } @@ -52,7 +52,7 @@ class invalid_input_exception : public geometry::exception inline invalid_input_exception() {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Boost.Geometry Invalid-Input exception"; } @@ -77,7 +77,7 @@ class empty_input_exception : public geometry::invalid_input_exception inline empty_input_exception() {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Boost.Geometry Empty-Input exception"; } @@ -96,7 +96,7 @@ class invalid_output_exception : public geometry::exception inline invalid_output_exception() {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Boost.Geometry Invalid-Output exception"; } diff --git a/include/boost/geometry/extensions/gis/io/shapefile/read.hpp b/include/boost/geometry/extensions/gis/io/shapefile/read.hpp index b6a9eaa2e8..5de6af7f99 100644 --- a/include/boost/geometry/extensions/gis/io/shapefile/read.hpp +++ b/include/boost/geometry/extensions/gis/io/shapefile/read.hpp @@ -52,7 +52,7 @@ class read_shapefile_exception : public geometry::exception : m_msg(msg) {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { //return "Shapefile read error"; return m_msg.what(); diff --git a/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp b/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp index eeabbc891d..a2af9a0ed1 100644 --- a/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp +++ b/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp @@ -32,7 +32,7 @@ class shapelib_file_create_exception : public geometry::exception : m_filename(filename) {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { return m_filename.c_str(); } diff --git a/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp b/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp index 7d1e0c95be..1a41389832 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp @@ -49,7 +49,7 @@ class read_wkb_exception : public geometry::exception inline read_wkb_exception() {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Boost.Geometry Read WKB exception"; } diff --git a/include/boost/geometry/io/wkt/read.hpp b/include/boost/geometry/io/wkt/read.hpp index a8d0f6a484..047be6fbf2 100644 --- a/include/boost/geometry/io/wkt/read.hpp +++ b/include/boost/geometry/io/wkt/read.hpp @@ -96,9 +96,9 @@ struct read_wkt_exception : public geometry::exception complete = message + "' in (" + wkt.substr(0, 100) + ")"; } - virtual ~read_wkt_exception() throw() {} + virtual ~read_wkt_exception() {} - virtual const char* what() const throw() + virtual const char* what() const noexcept { return complete.c_str(); } diff --git a/include/boost/geometry/srs/projections/exception.hpp b/include/boost/geometry/srs/projections/exception.hpp index c96ee005a5..d15d4933ec 100644 --- a/include/boost/geometry/srs/projections/exception.hpp +++ b/include/boost/geometry/srs/projections/exception.hpp @@ -43,7 +43,7 @@ class projection_exception : public geometry::exception , m_msg(msg) {} - virtual char const* what() const throw() + virtual char const* what() const noexcept { //return "Boost.Geometry Projection exception"; return m_msg.what(); diff --git a/include/boost/geometry/srs/projections/str_cast.hpp b/include/boost/geometry/srs/projections/str_cast.hpp index e3729e2be5..f9f7b63058 100644 --- a/include/boost/geometry/srs/projections/str_cast.hpp +++ b/include/boost/geometry/srs/projections/str_cast.hpp @@ -21,7 +21,7 @@ namespace boost { namespace geometry class bad_str_cast : public geometry::exception { - virtual char const* what() const throw() + virtual char const* what() const noexcept { return "Unable to convert from string."; } diff --git a/index/test/rtree/exceptions/test_throwing.hpp b/index/test/rtree/exceptions/test_throwing.hpp index c88a5f56e3..69306159d3 100644 --- a/index/test/rtree/exceptions/test_throwing.hpp +++ b/index/test/rtree/exceptions/test_throwing.hpp @@ -15,7 +15,7 @@ struct throwing_value_copy_exception : public std::exception { - const char * what() const throw() { return "value copy failed."; } + const char * what() const noexcept { return "value copy failed."; } }; struct throwing_value @@ -79,7 +79,7 @@ struct value< std::pair, throwing_value> > struct throwing_varray_exception : public std::exception { - const char * what() const throw() { return "static vector exception."; } + const char * what() const noexcept { return "static vector exception."; } }; struct throwing_varray_settings diff --git a/index/test/rtree/exceptions/test_throwing_node.hpp b/index/test/rtree/exceptions/test_throwing_node.hpp index e245d79642..0224efb632 100644 --- a/index/test/rtree/exceptions/test_throwing_node.hpp +++ b/index/test/rtree/exceptions/test_throwing_node.hpp @@ -250,7 +250,7 @@ class allocators struct node_bad_alloc : public std::exception { - const char * what() const throw() { return "internal node creation failed."; } + const char * what() const noexcept { return "internal node creation failed."; } }; struct throwing_node_settings diff --git a/test/core/assert.cpp b/test/core/assert.cpp index 59d90dee1e..2393c25163 100644 --- a/test/core/assert.cpp +++ b/test/core/assert.cpp @@ -20,7 +20,7 @@ struct assert_failure_exception : std::exception { - const char * what() const throw() + const char * what() const noexcept { return "assertion failure"; }