Skip to content

Commit

Permalink
Merge pull request open-source-parsers#552 from omki2005/noexcept
Browse files Browse the repository at this point in the history
change throw() to noexcept to conform to c++11
  • Loading branch information
cdunn2001 authored Nov 8, 2016
2 parents f880a94 + 91c1d23 commit 34fc002
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion include/json/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,16 @@
// managable and fixes a set of common hard-to-find bugs.
#if __cplusplus >= 201103L
# define JSONCPP_OVERRIDE override
#elif defined(_MSC_VER) && _MSC_VER > 1600
# define JSONCPP_NOEXCEPT noexcept
#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
# define JSONCPP_OVERRIDE override
# define JSONCPP_NOEXCEPT throw()
#elif defined(_MSC_VER) && _MSC_VER >= 1900
# define JSONCPP_OVERRIDE override
# define JSONCPP_NOEXCEPT noexcept
#else
# define JSONCPP_OVERRIDE
# define JSONCPP_NOEXCEPT throw()
#endif

#ifndef JSON_HAS_RVALUE_REFERENCES
Expand Down
4 changes: 2 additions & 2 deletions include/json/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ namespace Json {
class JSON_API Exception : public std::exception {
public:
Exception(JSONCPP_STRING const& msg);
~Exception() throw() JSONCPP_OVERRIDE;
char const* what() const throw() JSONCPP_OVERRIDE;
~Exception() JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
char const* what() const JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
protected:
JSONCPP_STRING msg_;
};
Expand Down
4 changes: 2 additions & 2 deletions src/lib_json/json_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ namespace Json {
Exception::Exception(JSONCPP_STRING const& msg)
: msg_(msg)
{}
Exception::~Exception() throw()
Exception::~Exception() JSONCPP_NOEXCEPT
{}
char const* Exception::what() const throw()
char const* Exception::what() const JSONCPP_NOEXCEPT
{
return msg_.c_str();
}
Expand Down

0 comments on commit 34fc002

Please sign in to comment.