fix compilation issue with string_view

This commit is contained in:
greg
2020-03-28 17:46:47 -04:00
parent 2f30618e64
commit 9f64feed0c
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -296,7 +296,8 @@
#endif
#ifdef __has_include
#if __has_include(<string_view>) && __cplusplus >= 201703L
#if __has_include(<string_view>) && __cplusplus >= 201703L && \
(!defined(_MSC_VER) || _MSC_VER >= 1920) // vs2019
#define PHMAP_HAVE_STD_STRING_VIEW 1
#endif
#endif
@@ -308,7 +309,9 @@
// #define PHMAP_HAVE_STD_ANY 1
#define PHMAP_HAVE_STD_OPTIONAL 1
#define PHMAP_HAVE_STD_VARIANT 1
#define PHMAP_HAVE_STD_STRING_VIEW 1
#if !defined(PHMAP_HAVE_STD_STRING_VIEW) && _MSC_VER >= 1920
#define PHMAP_HAVE_STD_STRING_VIEW 1
#endif
#endif
#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703) || __cplusplus >= 201703
+1 -1
View File
@@ -123,7 +123,7 @@ private:
typedef std::true_type yes;
typedef std::false_type no;
template<typename U> static auto test(int) -> decltype(hash_value(std::declval<U&>()) == 1, yes());
template<typename U> static auto test(int) -> decltype(hash_value(std::declval<const U&>()) == 1, yes());
template<typename> static no test(...);