Skip to content

Commit

Permalink
node/convert: Enable the template specialization for `std::string_vie…
Browse files Browse the repository at this point in the history
…w` properly when the library is compiled by MSVC on Windows.
  • Loading branch information
0xFireWolf committed Sep 11, 2023
1 parent 016b2e7 commit 38cda4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/yaml-cpp/node/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <valarray>
#include <vector>

#if __cplusplus >= 201703L
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#include <string_view>
#endif

Expand Down Expand Up @@ -93,7 +93,7 @@ struct convert<char[N]> {
static Node encode(const char* rhs) { return Node(rhs); }
};

#if __cplusplus >= 201703L
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
template <>
struct convert<std::string_view> {
static Node encode(std::string_view rhs) { return Node(std::string(rhs)); }
Expand Down

0 comments on commit 38cda4d

Please sign in to comment.