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.
This commit is contained in:
parent
91920e7c3b
commit
bd72fce0a7
|
@ -14,7 +14,9 @@
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
// apple compiler somehow has string_view even in c++11!
|
// 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 <boost/version.hpp>
|
#include <boost/version.hpp>
|
||||||
#if BOOST_VERSION > 105400
|
#if BOOST_VERSION > 105400
|
||||||
#include <boost/utility/string_view.hpp>
|
#include <boost/utility/string_view.hpp>
|
||||||
|
@ -23,8 +25,6 @@ using boost::string_view;
|
||||||
#include <boost/utility/string_ref.hpp>
|
#include <boost/utility/string_ref.hpp>
|
||||||
using string_view = boost::string_ref;
|
using string_view = boost::string_ref;
|
||||||
#endif
|
#endif
|
||||||
#else // C++17
|
|
||||||
using std::string_view;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue