Unverified Commit 62622011 authored by Kefu Chai's avatar Kefu Chai Committed by GitHub
Browse files

node/convert: relax the check for string_view (#1222)

parent fcbb8193
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
#include <type_traits> #include <type_traits>
#include <valarray> #include <valarray>
#include <vector> #include <vector>
#include <version>
#if __cplusplus >= 201703L #ifdef __cpp_lib_string_view
#include <string_view> #include <string_view>
#endif #endif
...@@ -93,7 +94,7 @@ struct convert<char[N]> { ...@@ -93,7 +94,7 @@ struct convert<char[N]> {
static Node encode(const char* rhs) { return Node(rhs); } static Node encode(const char* rhs) { return Node(rhs); }
}; };
#if __cplusplus >= 201703L #ifdef __cpp_lib_string_view
template <> template <>
struct convert<std::string_view> { struct convert<std::string_view> {
static Node encode(std::string_view rhs) { return Node(std::string(rhs)); } static Node encode(std::string_view rhs) { return Node(std::string(rhs)); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment