Fix conversion for C-strings (both literals and normal C-strings) so it compiles on Visual Studio.

This commit is contained in:
Jesse Beder
2013-04-01 22:25:53 -05:00
parent f5418306d6
commit 5dbcf7eeb1
3 changed files with 22 additions and 1 deletions

View File

@@ -47,7 +47,22 @@ namespace YAML
}
};
// C-strings can only be encoded
template<>
struct convert<const char *> {
static Node encode(const char *&rhs) {
return Node(rhs);
}
};
template<std::size_t N>
struct convert<const char[N]> {
static Node encode(const char (&rhs)[N]) {
return Node(rhs);
}
};
template<>
struct convert<_Null> {
static Node encode(const _Null& /* rhs */) {
return Node();