mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 12:21:17 +00:00
node/convert: support conversion for std::string_view (#1148)
This commit is contained in:
@@ -356,6 +356,15 @@ TEST(NodeTest, ConstInteratorOnSequence) {
|
||||
EXPECT_EQ(3, count);
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
TEST(NodeTest, StdStringViewAsKey) {
|
||||
Node node;
|
||||
std::string_view key = "username";
|
||||
node[key] = "monkey";
|
||||
EXPECT_EQ("monkey", node[key].as<std::string>());
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(NodeTest, SimpleSubkeys) {
|
||||
Node node;
|
||||
node["device"]["udid"] = "12345";
|
||||
|
Reference in New Issue
Block a user