aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-03-13 17:38:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-03-13 17:38:01 +0200
commitde7027a40383b67ea3a52e1475fde097d39f7c70 (patch)
tree16e4ef696faac825e5e81949320cf29a0980762b
parenta82ec3c21ac680e5bf9614bdcf50ea78a52542ce (diff)
Fix std::optional usage test for VC 16.0
-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__)
//