Skip to content

Commit

Permalink
Replace virtual with override in exception::what()
Browse files Browse the repository at this point in the history
  • Loading branch information
georgthegreat committed Sep 8, 2023
1 parent 92c7462 commit e0e8a30
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 19 deletions.
9 changes: 1 addition & 8 deletions include/boost/geometry/algorithms/centroid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,9 @@ class centroid_exception : public geometry::exception
{
public:

/*!
\brief The default constructor
*/
inline centroid_exception() {}

/*!
\brief Returns the explanatory string.
\return Pointer to a null-terminated string with explanatory information.
*/
virtual char const* what() const noexcept
char const* what() const noexcept override
{
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 noexcept
char const* what() const noexcept override
{
return "Boost.Geometry Overlay invalid input exception";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class inconsistent_turns_exception : public geometry::exception

inline inconsistent_turns_exception() {}

virtual char const* what() const noexcept
char const* what() const noexcept override
{
return "Boost.Geometry Inconsistent Turns exception";
}
Expand Down
6 changes: 3 additions & 3 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 noexcept
char const* what() const noexcept override
{
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 noexcept
char const* what() const noexcept override
{
return "Boost.Geometry Invalid-Input exception";
}
Expand Down Expand Up @@ -96,7 +96,7 @@ class invalid_output_exception : public geometry::exception

inline invalid_output_exception() {}

virtual char const* what() const noexcept
char const* what() const noexcept override
{
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 noexcept
char const* what() const noexcept override
{
//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 noexcept
char const* what() const noexcept override
{
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 noexcept
char const* what() const noexcept override
{
return "Boost.Geometry Read WKB exception";
}
Expand Down
2 changes: 1 addition & 1 deletion include/boost/geometry/io/wkt/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct read_wkt_exception : public geometry::exception
complete = message + "' in (" + wkt.substr(0, 100) + ")";
}

virtual const char* what() const noexcept
const char* what() const noexcept override
{
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 noexcept
char const* what() const noexcept override
{
//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 noexcept
char const* what() const noexcept override
{
return "Unable to convert from string.";
}
Expand Down

0 comments on commit e0e8a30

Please sign in to comment.