From bd72fce0a7e5ec77a042d2701158f58f64563172 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 6 Jun 2020 10:56:46 -0700 Subject: [PATCH] Use std::string_view whenever possible std::string_view is available with libcxx, even in C++11 mode. Use the proper macro to check it. --- lmdb-safe.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lmdb-safe.hh b/lmdb-safe.hh index ff28466..c34b542 100644 --- a/lmdb-safe.hh +++ b/lmdb-safe.hh @@ -14,7 +14,9 @@ #include // apple compiler somehow has string_view even in c++11! -#if __cplusplus < 201703L && !defined(__APPLE__) +#ifdef __cpp_lib_string_view +using std::string_view; +#else #include #if BOOST_VERSION > 105400 #include @@ -23,8 +25,6 @@ using boost::string_view; #include using string_view = boost::string_ref; #endif -#else // C++17 -using std::string_view; #endif