Closed rtkid-nik closed 1 year ago
Error
string_view_support.hpp:11:8 error: redefinition of 'convert<std::string_view>' struct convert<std::string_view> { ^~~~~~~~~~~~~~~~~~~~~~~~~ /opt/homebrew/include/yaml-cpp/node/convert.h:98:8: note: previous definition is here struct convert<std::string_view> {
yaml-cpp
#if __cplusplus >= 201703L template <> struct convert<std::string_view> { static Node encode(std::string_view rhs) { return Node(std::string(rhs)); } static bool decode(const Node& node, std::string_view& rhs) { if (!node.IsScalar()) return false; rhs = node.Scalar(); return true; } }; #endif
userver
template <> struct convert<std::string_view> { static Node encode(const std::string_view& rhs) { return Node(std::string{rhs}); } static bool decode(const Node& node, std::string_view& rhs) { if (!node.IsScalar()) return false; rhs = node.Scalar(); return true; } };
Solution: remove from userver template instantiation or add #if __cplusplus < 201703L
#if __cplusplus < 201703L
Many thanks for the bug report!
Error
yaml-cpp
userver
Solution: remove from userver template instantiation or add
#if __cplusplus < 201703L