Add vector<bool> support in format::as_array.
GitOrigin-RevId: 3a9a64187eb773a2daac85eb5bb18e77f25f6ab5
This commit is contained in:
parent
b20bd84e22
commit
29e83d3808
@ -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};
|
||||
|
Reference in New Issue
Block a user