Skip to content

Commit

Permalink
Modernize noexcept specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
georgthegreat committed Sep 1, 2023
1 parent 956998d commit 3502521
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion include/boost/geometry/algorithms/centroid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ class turn_info_exception : public geometry::exception
message += method;
}

virtual ~turn_info_exception() throw()
{}

virtual char const* what() const throw()
virtual char const* What() const noexcept
{
return message.c_str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ class inconsistent_turns_exception : public geometry::exception

inline inconsistent_turns_exception() {}

virtual ~inconsistent_turns_exception() throw()
{}

virtual char const* what() const throw()
virtual char const* what() const noexcept
{
return "Boost.Geometry Inconsistent Turns exception";
}
Expand Down
8 changes: 4 additions & 4 deletions include/boost/geometry/core/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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";
}
Expand All @@ -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";
}
Expand All @@ -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";
}
Expand Down
4 changes: 1 addition & 3 deletions include/boost/geometry/io/wkt/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ struct read_wkt_exception : public geometry::exception
complete = message + "' in (" + wkt.substr(0, 100) + ")";
}

virtual ~read_wkt_exception() throw() {}

virtual const char* what() const throw()
virtual const char* what() const noexcept
{
return complete.c_str();
}
Expand Down
2 changes: 1 addition & 1 deletion include/boost/geometry/srs/projections/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion include/boost/geometry/srs/projections/str_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
}
Expand Down
4 changes: 2 additions & 2 deletions index/test/rtree/exceptions/test_throwing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -79,7 +79,7 @@ struct value< std::pair<bg::model::point<T, 2, C>, 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
Expand Down
2 changes: 1 addition & 1 deletion index/test/rtree/exceptions/test_throwing_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class allocators<Allocator, Value, Parameters, Box, node_throwing_static_tag>

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
Expand Down
2 changes: 1 addition & 1 deletion test/core/assert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
struct assert_failure_exception
: std::exception
{
const char * what() const throw()
const char * what() const noexcept
{
return "assertion failure";
}
Expand Down

0 comments on commit 3502521

Please sign in to comment.