From 49b3c9121e45833016267ea60c4e7c1101d3d282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:00:40 +0100 Subject: [PATCH] external: updated std::optional with fixed MSVC 2013 port. --- external/Optional/optional.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/external/Optional/optional.hpp b/external/Optional/optional.hpp index 96145069f..82c995acc 100644 --- a/external/Optional/optional.hpp +++ b/external/Optional/optional.hpp @@ -195,7 +195,7 @@ template inline constexpr typename std::remove_reference::type&& co # elif defined __GNUC__ _assert(expr, file, line); # elif defined _MSC_VER - _CrtDbgReport(_CRT_ASSERT, file, line, expr); + _CrtDbgReport(_CRT_ASSERT, file, line, expr, ""); # else # error UNSUPPORTED COMPILER # endif @@ -230,11 +230,15 @@ T* static_addressof(T& ref) return std::addressof(ref); } #else +# if (defined _MSC_VER) && _MSC_VER >= 1800 + // leave it; our metafunctions are already defined. +# else template T* addressof(T& ref) { return reinterpret_cast(&const_cast(reinterpret_cast(ref))); } +#endif template T* static_addressof(T& ref) { @@ -420,7 +424,7 @@ struct constexpr_optional_base }; #endif -# if OPTIONAL_HAS_USING +# if OPTIONAL_HAS_USING && OPTIONAL_HAS_CONSTEXPR_NOEXCEPT template using OptionalBase = typename std::conditional< std::is_trivially_destructible::value,