From 29e83d3808b87524bf36af0e8c3eca7466935500 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 3 Oct 2019 17:19:13 +0300 Subject: [PATCH] Add vector support in format::as_array. GitOrigin-RevId: 3a9a64187eb773a2daac85eb5bb18e77f25f6ab5 --- tdutils/td/utils/format.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tdutils/td/utils/format.h b/tdutils/td/utils/format.h index 14b13ef1b..a3f4f260c 100644 --- a/tdutils/td/utils/format.h +++ b/tdutils/td/utils/format.h @@ -227,6 +227,19 @@ StringBuilder &operator<<(StringBuilder &stream, const Array &array) { return stream << Slice("}"); } +inline StringBuilder &operator<<(StringBuilder &stream, const Array> &array) { + bool first = true; + stream << Slice("{"); + for (bool x : array.ref) { + if (!first) { + stream << Slice(", "); + } + stream << x; + first = false; + } + return stream << Slice("}"); +} + template Array as_array(const ArrayT &array) { return Array{array};