From c045f7e8e76980e6b19337d2f14c4b8c1d1124ba Mon Sep 17 00:00:00 2001 From: Elviss Strazdins Date: Tue, 26 Jul 2016 17:52:00 +0300 Subject: [PATCH] Use _NOEXCEPT on Visual Studio instead of noexcept --- include/yaml-cpp/exceptions.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/yaml-cpp/exceptions.h b/include/yaml-cpp/exceptions.h index 5d44c05..4798ccc 100644 --- a/include/yaml-cpp/exceptions.h +++ b/include/yaml-cpp/exceptions.h @@ -7,6 +7,12 @@ #pragma once #endif +#ifdef _MSC_VER +#define NOEXCEPT _NOEXCEPT +#else +#define NOEXCEPT noexcept +#endif + #include "yaml-cpp/mark.h" #include "yaml-cpp/traits.h" #include @@ -112,7 +118,7 @@ class Exception : public std::runtime_error { public: Exception(const Mark& mark_, const std::string& msg_) : std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {} - virtual ~Exception() noexcept {} + virtual ~Exception() NOEXCEPT {} Exception(const Exception&) = default; @@ -165,7 +171,7 @@ class TypedKeyNotFound : public KeyNotFound { public: TypedKeyNotFound(const Mark& mark_, const T& key_) : KeyNotFound(mark_, key_), key(key_) {} - virtual ~TypedKeyNotFound() noexcept {} + virtual ~TypedKeyNotFound() NOEXCEPT {} T key; };