[geos-commits] [SCM] GEOS branch master updated. 3de3ccc96a22030e65d0200f4d35a076617361d9

git at osgeo.org git at osgeo.org
Wed Jul 25 12:49:17 PDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  3de3ccc96a22030e65d0200f4d35a076617361d9 (commit)
      from  c7a5e5c6fae0e553e943f32af4f279eaafeb2231 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3de3ccc96a22030e65d0200f4d35a076617361d9
Author: Daniel Baston <dbaston at gmail.com>
Date:   Wed Jul 18 09:47:23 2018 -0400

    Make GEOSException inherit from std::runtime_error
    
    This avoids a bunch of "thrown exception is not nothrow
    copy-constructible" warnings from clang-tidy.
    
    A description of the issue is available at
    https://wiki.sei.cmu.edu/confluence/display/cplusplus/ERR60-CPP.+Exception+objects+must+be+nothrow+copy+constructible
    
    Closes https://github.com/libgeos/geos/pull/107

diff --git a/include/geos/util/GEOSException.h b/include/geos/util/GEOSException.h
index b92098a..a1ead30 100644
--- a/include/geos/util/GEOSException.h
+++ b/include/geos/util/GEOSException.h
@@ -33,38 +33,27 @@ namespace util { // geos.util
  *
  * \brief Base class for all GEOS exceptions.
  *
- * Exceptions are thrown as pointers to this type.
- * Use toString() to get a readable message.
+ * Use what() to get a readable message.
  */
-class GEOS_DLL GEOSException: public std::exception {
-
-	std::string _msg;
+class GEOS_DLL GEOSException: public std::runtime_error {
 
 public:
 
 	GEOSException()
 		:
-		_msg("Unknown error")
+		std::runtime_error("Unknown error")
 	{}
 
 	GEOSException(std::string const& msg)
 		:
-		_msg(msg)
+		std::runtime_error(msg)
 	{}
 
 	GEOSException(std::string const& name, std::string const& msg)
 		:
-		_msg(name+": "+msg)
-	{}
-
-	~GEOSException() throw() override
+		std::runtime_error(name + ": "+msg)
 	{}
 
-	const char* what() const throw() override
-	{
-		return _msg.c_str();
-	}
-
 };
 
 } // namespace geos.util

-----------------------------------------------------------------------

Summary of changes:
 include/geos/util/GEOSException.h | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list