Remove or replace obsolete uses of throw()

In C++11, destructors are 'noexcept' by default -> remove useless
throw() specifiers. There was one case that wasn't about a destructor: I
replaced the 'throw()' with 'noexcept' because this use of 'throw()' is
deprecated and 'noexcept' offers the intended meaning as far as I can
guess (in C++17, 'throw()' will be equivalent to 'noexcept' anyway). For
more info, see:

  http://en.cppreference.com/w/cpp/language/noexcept_spec
  https://akrzemi1.wordpress.com/2013/08/20/noexcept-destructors/
This commit is contained in:
Florent Rougon
2017-11-12 09:56:26 +01:00
parent f22b9ba9f1
commit 19dd92d3e0
6 changed files with 21 additions and 21 deletions
@@ -39,7 +39,7 @@ namespace nasal
}
//----------------------------------------------------------------------------
bad_nasal_cast::~bad_nasal_cast() throw()
bad_nasal_cast::~bad_nasal_cast()
{
}
@@ -70,7 +70,7 @@ namespace nasal
*/
explicit bad_nasal_cast(const std::string& msg);
virtual ~bad_nasal_cast() throw();
virtual ~bad_nasal_cast();
protected:
std::string _msg;
+1 -1
View File
@@ -85,7 +85,7 @@ BuilderException::BuilderException(const std::string& message,
{
}
BuilderException::~BuilderException() throw()
BuilderException::~BuilderException()
{
}
+1 -1
View File
@@ -184,7 +184,7 @@ public:
BuilderException();
BuilderException(const char* message, const char* origin = 0);
BuilderException(const std::string& message, const std::string& = "");
virtual ~BuilderException() throw();
virtual ~BuilderException();
};
}
+8 -8
View File
@@ -49,7 +49,7 @@ sg_location::sg_location (const char* path, int line, int column)
setPath(path);
}
sg_location::~sg_location () throw ()
sg_location::~sg_location ()
{
}
@@ -144,7 +144,7 @@ sg_throwable::sg_throwable (const char* message, const char* origin)
setOrigin(origin);
}
sg_throwable::~sg_throwable () throw ()
sg_throwable::~sg_throwable ()
{
}
@@ -185,7 +185,7 @@ sg_throwable::setOrigin (const char* origin)
}
}
const char* sg_throwable::what() const throw()
const char* sg_throwable::what() const noexcept
{
try {
return getMessage();
@@ -215,7 +215,7 @@ sg_error::sg_error(const std::string& message, const std::string& origin)
{
}
sg_error::~sg_error () throw ()
sg_error::~sg_error ()
{
}
@@ -239,7 +239,7 @@ sg_exception::sg_exception( const std::string& message,
{
}
sg_exception::~sg_exception () throw ()
sg_exception::~sg_exception ()
{
}
@@ -279,7 +279,7 @@ sg_io_exception::sg_io_exception( const std::string& message,
{
}
sg_io_exception::~sg_io_exception () throw ()
sg_io_exception::~sg_io_exception ()
{
}
@@ -335,7 +335,7 @@ sg_format_exception::sg_format_exception( const std::string& message,
setText(text.c_str());
}
sg_format_exception::~sg_format_exception () throw ()
sg_format_exception::~sg_format_exception ()
{
}
@@ -379,7 +379,7 @@ sg_range_exception::sg_range_exception(const std::string& message,
{
}
sg_range_exception::~sg_range_exception () throw ()
sg_range_exception::~sg_range_exception ()
{
}
// end of exception.cxx
+9 -9
View File
@@ -31,7 +31,7 @@ public:
sg_location(const std::string& path, int line = -1, int column = -1);
sg_location(const SGPath& path, int line = -1, int column = -1);
explicit sg_location(const char* path, int line = -1, int column = -1);
virtual ~sg_location() throw ();
virtual ~sg_location();
virtual const char* getPath() const;
virtual void setPath (const char* path);
virtual int getLine () const;
@@ -58,13 +58,13 @@ public:
enum {MAX_TEXT_LEN = 1024};
sg_throwable ();
sg_throwable (const char* message, const char* origin = 0);
virtual ~sg_throwable () throw ();
virtual ~sg_throwable ();
virtual const char* getMessage () const;
virtual const std::string getFormattedMessage () const;
virtual void setMessage (const char* message);
virtual const char* getOrigin () const;
virtual void setOrigin (const char *origin);
virtual const char* what() const throw();
virtual const char* what() const noexcept;
private:
char _message[MAX_TEXT_LEN];
char _origin[MAX_TEXT_LEN];
@@ -87,7 +87,7 @@ public:
sg_error ();
sg_error (const char* message, const char* origin = 0);
sg_error (const std::string& message, const std::string& origin = "");
virtual ~sg_error () throw ();
virtual ~sg_error ();
};
@@ -111,7 +111,7 @@ public:
sg_exception ();
sg_exception (const char* message, const char* origin = 0);
sg_exception (const std::string& message, const std::string& = "");
virtual ~sg_exception () throw ();
virtual ~sg_exception ();
};
@@ -136,8 +136,8 @@ public:
sg_io_exception (const std::string &message, const std::string &origin = "");
sg_io_exception (const std::string &message, const sg_location &location,
const std::string &origin = "");
virtual ~sg_io_exception () throw ();
virtual ~sg_io_exception ();
virtual const std::string getFormattedMessage () const;
virtual const sg_location &getLocation () const;
virtual void setLocation (const sg_location &location);
@@ -165,7 +165,7 @@ public:
const char* origin = 0);
sg_format_exception (const std::string& message, const std::string& text,
const std::string& origin = "");
virtual ~sg_format_exception () throw ();
virtual ~sg_format_exception ();
virtual const char* getText () const;
virtual void setText (const char* text);
private:
@@ -190,7 +190,7 @@ public:
const char* origin = 0);
sg_range_exception (const std::string& message,
const std::string& origin = "");
virtual ~sg_range_exception () throw ();
virtual ~sg_range_exception ();
};
#endif