aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbutl/optional.mxx9
1 files 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__)
//