Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace noexcept with macro compatible with VS (#517)
This way it's possible to build using older MSVC (<13) that don't support this yet. Macro is undefined in each file where it is used so it should stack well with other libs and sources.
- Loading branch information
Showing
2 changed files
with
49 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
#include "yaml-cpp/exceptions.h" | ||
|
||
// This is here for compatibility with older versions of Visual Studio | ||
// which don't support noexcept | ||
#ifdef _MSC_VER | ||
#define YAML_CPP_NOEXCEPT _NOEXCEPT | ||
#else | ||
#define YAML_CPP_NOEXCEPT noexcept | ||
#endif | ||
|
||
namespace YAML { | ||
|
||
// These destructors are defined out-of-line so the vtable is only emitted once. | ||
Exception::~Exception() noexcept {} | ||
ParserException::~ParserException() noexcept {} | ||
RepresentationException::~RepresentationException() noexcept {} | ||
InvalidScalar::~InvalidScalar() noexcept {} | ||
KeyNotFound::~KeyNotFound() noexcept {} | ||
InvalidNode::~InvalidNode() noexcept {} | ||
BadConversion::~BadConversion() noexcept {} | ||
BadDereference::~BadDereference() noexcept {} | ||
BadSubscript::~BadSubscript() noexcept {} | ||
BadPushback::~BadPushback() noexcept {} | ||
BadInsert::~BadInsert() noexcept {} | ||
EmitterException::~EmitterException() noexcept {} | ||
BadFile::~BadFile() noexcept {} | ||
Exception::~Exception() YAML_CPP_NOEXCEPT {} | ||
ParserException::~ParserException() YAML_CPP_NOEXCEPT {} | ||
RepresentationException::~RepresentationException() YAML_CPP_NOEXCEPT {} | ||
InvalidScalar::~InvalidScalar() YAML_CPP_NOEXCEPT {} | ||
KeyNotFound::~KeyNotFound() YAML_CPP_NOEXCEPT {} | ||
InvalidNode::~InvalidNode() YAML_CPP_NOEXCEPT {} | ||
BadConversion::~BadConversion() YAML_CPP_NOEXCEPT {} | ||
BadDereference::~BadDereference() YAML_CPP_NOEXCEPT {} | ||
BadSubscript::~BadSubscript() YAML_CPP_NOEXCEPT {} | ||
BadPushback::~BadPushback() YAML_CPP_NOEXCEPT {} | ||
BadInsert::~BadInsert() YAML_CPP_NOEXCEPT {} | ||
EmitterException::~EmitterException() YAML_CPP_NOEXCEPT {} | ||
BadFile::~BadFile() YAML_CPP_NOEXCEPT {} | ||
} | ||
|
||
#undef YAML_CPP_NOEXCEPT | ||
|
||
|