mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
node/convert: Enable the template specialization for std::string_view
properly when the library is compiled by MSVC on Windows. (#1227)
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
#include <valarray>
|
#include <valarray>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if __cplusplus >= 201703L
|
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -93,7 +93,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
|
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
||||||
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)); }
|
||||||
|
Reference in New Issue
Block a user