Return iterator from the format method

This commit is contained in:
Victor Zverovich
2018-01-14 11:00:27 -08:00
parent 67928eae28
commit 91ee9c9acd
7 changed files with 66 additions and 38 deletions
+2 -1
View File
@@ -103,11 +103,12 @@ struct formatter<T, Char,
: formatter<basic_string_view<Char>, Char> {
template <typename Context>
void format(const T &value, Context &ctx) {
auto format(const T &value, Context &ctx) -> decltype(ctx.begin()) {
basic_memory_buffer<Char> buffer;
internal::format_value(buffer, value);
basic_string_view<Char> str(buffer.data(), buffer.size());
formatter<basic_string_view<Char>, Char>::format(str, ctx);
return ctx.begin();
}
};