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
@@ -30,7 +30,7 @@ struct formatter<std::tm> {
return pointer_from(end);
}
void format(const std::tm &tm, context &ctx) {
auto format(const std::tm &tm, context &ctx) -> decltype(ctx.begin()) {
buffer &buf = ctx.range().container();
std::size_t start = buf.size();
for (;;) {
@@ -50,6 +50,7 @@ struct formatter<std::tm> {
const std::size_t MIN_GROWTH = 10;
buf.reserve(buf.capacity() + (size > MIN_GROWTH ? size : MIN_GROWTH));
}
return ctx.begin();
}
memory_buffer tm_format;