Add vector<bool> support in format::as_array.

GitOrigin-RevId: 3a9a64187eb773a2daac85eb5bb18e77f25f6ab5
This commit is contained in:
levlam 2019-10-03 17:19:13 +03:00
parent b20bd84e22
commit 29e83d3808

View File

@ -227,6 +227,19 @@ StringBuilder &operator<<(StringBuilder &stream, const Array<ArrayT> &array) {
return stream << Slice("}");
}
inline StringBuilder &operator<<(StringBuilder &stream, const Array<vector<bool>> &array) {
bool first = true;
stream << Slice("{");
for (bool x : array.ref) {
if (!first) {
stream << Slice(", ");
}
stream << x;
first = false;
}
return stream << Slice("}");
}
template <class ArrayT>
Array<ArrayT> as_array(const ArrayT &array) {
return Array<ArrayT>{array};