@@ -151,7 +151,14 @@ ListType::ListType(int32_t field_id, std::shared_ptr<Type> type, bool optional)
151151 : element_(field_id, std::string(kElementName ), std::move(type), optional) {}
152152
153153TypeId ListType::type_id () const { return TypeId::kList ; }
154- std::string ListType::ToString () const { return std::format (" list<{}>" , element_); }
154+ std::string ListType::ToString () const {
155+ // XXX: work around Clang/libc++: "<{}>" in a format string appears to get
156+ // parsed as {<>} or something; split up the format string to avoid that
157+ std::string repr = " list<" ;
158+ std::format_to (std::back_inserter (repr), " {}" , element_);
159+ repr += " >" ;
160+ return repr;
161+ }
155162std::span<const SchemaField> ListType::fields () const { return {&element_, 1 }; }
156163std::optional<std::reference_wrapper<const SchemaField>> ListType::GetFieldById (
157164 int32_t field_id) const {
@@ -200,7 +207,13 @@ const SchemaField& MapType::key() const { return fields_[0]; }
200207const SchemaField& MapType::value () const { return fields_[1 ]; }
201208TypeId MapType::type_id () const { return TypeId::kMap ; }
202209std::string MapType::ToString () const {
203- return std::format (" map<{}: {}>" , key (), value ());
210+ // XXX: work around Clang/libc++: "<{}>" in a format string appears to get
211+ // parsed as {<>} or something; split up the format string to avoid that
212+ std::string repr = " map<" ;
213+
214+ std::format_to (std::back_inserter (repr), " {}: {}" , key (), value ());
215+ repr += " }" ;
216+ return repr;
204217}
205218std::span<const SchemaField> MapType::fields () const { return fields_; }
206219std::optional<std::reference_wrapper<const SchemaField>> MapType::GetFieldById (
0 commit comments