Replace buffer with range

This commit is contained in:
Victor Zverovich
2018-01-10 22:41:23 -08:00
parent c3d6c5fc4c
commit c095445394
14 changed files with 544 additions and 555 deletions
+8 -9
View File
@@ -1,11 +1,9 @@
/*
Formatting library for C++ - time formatting
Copyright (c) 2012 - 2016, Victor Zverovich
All rights reserved.
For the license information refer to format.h.
*/
// Formatting library for C++ - time formatting
//
// Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_TIME_H_
#define FMT_TIME_H_
@@ -32,7 +30,8 @@ struct formatter<std::tm> {
return pointer_from(end);
}
void format(buffer &buf, const std::tm &tm, context &) {
void format(const std::tm &tm, context &ctx) {
buffer &buf = ctx.range();
std::size_t start = buf.size();
for (;;) {
std::size_t size = buf.capacity() - start;