From a850108461602aebe21b8ba067decb4c967b5b14 Mon Sep 17 00:00:00 2001 From: vjacquet Date: Mon, 27 Jun 2016 05:45:15 +0200 Subject: [PATCH] Added noexcept work around for VS 2013. noexcept is support only starting VS 2015 --- include/gsl_assert.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/gsl_assert.h b/include/gsl_assert.h index 7b5de77..be3a9df 100644 --- a/include/gsl_assert.h +++ b/include/gsl_assert.h @@ -22,6 +22,18 @@ #include #include +#ifdef _MSC_VER + +// MSVC 2013 workarounds +#if _MSC_VER <= 1800 +// noexcept is not understood +#pragma push_macro("noexcept") +#define noexcept + +#endif // _MSC_VER <= 1800 + +#endif // _MSC_VER + // // There are three configuration options for this GSL implementation's behavior // when pre/post conditions on the GSL types are violated: @@ -87,4 +99,16 @@ namespace details #endif +#ifdef _MSC_VER + +#if _MSC_VER <= 1800 + +#undef noexcept +#pragma pop_macro("noexcept") + +#endif // _MSC_VER <= 1800 + +#endif // _MSC_VER + + #endif // GSL_CONTRACTS_H