diff --git a/fmt/format.h b/fmt/format.h index 038bfd94..fd8fc657 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -3870,69 +3870,63 @@ void BasicFormatter::format(BasicCStringRef format_str) { template struct ArgJoin { - It first; - It last; - BasicCStringRef sep; + It first; + It last; + BasicCStringRef sep; - ArgJoin(It first, It last, const BasicCStringRef& sep) : - first(first), - last(last), - sep(sep) - { - } + ArgJoin(It first, It last, const BasicCStringRef& sep) : + first(first), + last(last), + sep(sep) {} }; template -ArgJoin join(It first, It last, const BasicCStringRef& sep) -{ - return ArgJoin(first, last, sep); +ArgJoin join(It first, It last, const BasicCStringRef& sep) { + return ArgJoin(first, last, sep); } template -ArgJoin join(It first, It last, const BasicCStringRef& sep) -{ - return ArgJoin(first, last, sep); +ArgJoin join(It first, It last, const BasicCStringRef& sep) { + return ArgJoin(first, last, sep); } #if FMT_HAS_GXX_CXX11 template -auto join(const Range& range, const BasicCStringRef& sep) -> ArgJoin -{ - return join(std::begin(range), std::end(range), sep); +auto join(const Range& range, const BasicCStringRef& sep) + -> ArgJoin { + return join(std::begin(range), std::end(range), sep); } template -auto join(const Range& range, const BasicCStringRef& sep) -> ArgJoin -{ - return join(std::begin(range), std::end(range), sep); +auto join(const Range& range, const BasicCStringRef& sep) + -> ArgJoin { + return join(std::begin(range), std::end(range), sep); } #endif template void format_arg(fmt::BasicFormatter &f, - const Char *&format_str, const ArgJoin& e) { - const Char* end = format_str; - if (*end == ':') - ++end; - while (*end && *end != '}') - ++end; - if (*end != '}') - FMT_THROW(FormatError("missing '}' in format string")); + const Char *&format_str, const ArgJoin& e) { + const Char* end = format_str; + if (*end == ':') + ++end; + while (*end && *end != '}') + ++end; + if (*end != '}') + FMT_THROW(FormatError("missing '}' in format string")); - It it = e.first; - if (it != e.last) - { - const Char* save = format_str; + It it = e.first; + if (it != e.last) { + const Char* save = format_str; + f.format(format_str, internal::MakeArg >(*it++)); + while (it != e.last) { + f.writer().write(e.sep); + format_str = save; f.format(format_str, internal::MakeArg >(*it++)); - while (it != e.last) - { - f.writer().write(e.sep); - format_str = save; - f.format(format_str, internal::MakeArg >(*it++)); - } - } - format_str = end + 1; + } + } + format_str = end + 1; }