From de7027a40383b67ea3a52e1475fde097d39f7c70 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 13 Mar 2019 17:38:01 +0200 Subject: Fix std::optional usage test for VC 16.0 --- libbutl/optional.mxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libbutl/optional.mxx b/libbutl/optional.mxx index f41aab4..601e054 100644 --- a/libbutl/optional.mxx +++ b/libbutl/optional.mxx @@ -19,10 +19,13 @@ #elif defined(_MSC_VER) // // Available from 19.10 (15.0). Except it (or the compiler) doesn't seem to - // be constexpr-correct. Let's re-test with 16.0. + // be constexpr-correct. Things appear to be fixed in 19.20 (16.0) but + // optional is now only available in the C++17 mode or later. // -# if _MSC_VER > 1916 -# define LIBBUTL_STD_OPTIONAL +# if _MSC_VER >= 1920 +# if defined(_MSVC_LANG) && _MSVC_LANG >= 201703L // See /Zc:__cplusplus +# define LIBBUTL_STD_OPTIONAL +# endif # endif #elif defined(__clang__) // -- cgit v1.1