Skip to content

Commit 91c1d23

Browse files
author
Omkar Wagh
committed
change throw() to noexcept to conform to c++11
1 parent 0e24e3c commit 91c1d23

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

include/json/config.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,16 @@
8383
// managable and fixes a set of common hard-to-find bugs.
8484
#if __cplusplus >= 201103L
8585
# define JSONCPP_OVERRIDE override
86-
#elif defined(_MSC_VER) && _MSC_VER > 1600
86+
# define JSONCPP_NOEXCEPT noexcept
87+
#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
8788
# define JSONCPP_OVERRIDE override
89+
# define JSONCPP_NOEXCEPT throw()
90+
#elif defined(_MSC_VER) && _MSC_VER >= 1900
91+
# define JSONCPP_OVERRIDE override
92+
# define JSONCPP_NOEXCEPT noexcept
8893
#else
8994
# define JSONCPP_OVERRIDE
95+
# define JSONCPP_NOEXCEPT throw()
9096
#endif
9197

9298
#ifndef JSON_HAS_RVALUE_REFERENCES

include/json/value.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ namespace Json {
5353
class JSON_API Exception : public std::exception {
5454
public:
5555
Exception(JSONCPP_STRING const& msg);
56-
~Exception() throw() JSONCPP_OVERRIDE;
57-
char const* what() const throw() JSONCPP_OVERRIDE;
56+
~Exception() JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
57+
char const* what() const JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
5858
protected:
5959
JSONCPP_STRING msg_;
6060
};

src/lib_json/json_value.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ namespace Json {
193193
Exception::Exception(JSONCPP_STRING const& msg)
194194
: msg_(msg)
195195
{}
196-
Exception::~Exception() throw()
196+
Exception::~Exception() JSONCPP_NOEXCEPT
197197
{}
198-
char const* Exception::what() const throw()
198+
char const* Exception::what() const JSONCPP_NOEXCEPT
199199
{
200200
return msg_.c_str();
201201
}

0 commit comments

Comments
 (0)