Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize noexcept specifications #1191

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
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
Loading