Return JsonScope::operator<< overloads for string literals and pointers, because otherwise they are converted to bool.

GitOrigin-RevId: a699415fa15350be1daf9718239b295f272dc3ef
This commit is contained in:
levlam 2019-12-23 03:09:21 +03:00
parent 9788681015
commit 5fdb88a8ac

View File

@ -301,6 +301,13 @@ class JsonScope {
JsonScope &operator<<(double x) {
return *this << JsonFloat(x);
}
template <size_t N>
JsonScope &operator<<(const char (&x)[N]) {
return *this << JsonString(Slice(x));
}
JsonScope &operator<<(const char *x) {
return *this << JsonString(Slice(x));
}
JsonScope &operator<<(Slice x) {
return *this << JsonString(x);
}