+10
-10
lines changedFilter options
+10
-10
lines changed Original file line number Diff line number Diff line change
@@ -2279,7 +2279,7 @@ struct formatter<std::chrono::duration<Rep, Period>, Char> {
2279
2279
// As a possible future optimization, we could avoid extra copying if width
2280
2280
// is not specified.
2281
2281
auto buf = basic_memory_buffer<Char>();
2282
-
auto out = std::back_inserter(buf);
2282
+
auto out = basic_appender<Char>(buf);
2283
2283
detail::handle_dynamic_spec<detail::width_checker>(specs.width, width_ref_,
2284
2284
ctx);
2285
2285
detail::handle_dynamic_spec<detail::precision_checker>(precision,
@@ -2388,7 +2388,7 @@ template <typename Char> struct formatter<std::tm, Char> {
2388
2388
const Duration* subsecs) const -> decltype(ctx.out()) {
2389
2389
auto specs = specs_;
2390
2390
auto buf = basic_memory_buffer<Char>();
2391
-
auto out = std::back_inserter(buf);
2391
+
auto out = basic_appender<Char>(buf);
2392
2392
detail::handle_dynamic_spec<detail::width_checker>(specs.width, width_ref_,
2393
2393
ctx);
2394
2394
Original file line number Diff line number Diff line change
@@ -494,9 +494,9 @@ auto format_to_n(OutputIt out, size_t n, const S& fmt, Args&&... args)
494
494
495
495
template <typename S, typename... Args,
496
496
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
497
-
FMT_CONSTEXPR20 auto formatted_size(const S& fmt, const Args&... args)
498
-
-> size_t {
499
-
return fmt::format_to(detail::counting_iterator(), fmt, args...).count();
497
+
auto formatted_size(const S& fmt, const Args&... args) -> size_t {
498
+
auto buf = detail::counting_buffer<>();
499
+
return fmt::format_to(fmt::appender(buf), fmt, args...).count();
500
500
}
501
501
502
502
template <typename S, typename... Args,
Original file line number Diff line number Diff line change
@@ -1314,10 +1314,10 @@ FMT_CONSTEXPR20 auto format_decimal(Char* out, UInt value, int size)
1314
1314
return {begin + n, end};
1315
1315
}
1316
1316
1317
-
template <typename Char, typename UInt, typename Iterator,
1318
-
FMT_ENABLE_IF(!std::is_pointer<remove_cvref_t<Iterator>>::value)>
1319
-
FMT_CONSTEXPR inline auto format_decimal(Iterator out, UInt value, int size)
1320
-
-> format_decimal_result<Iterator> {
1317
+
template <typename Char, typename UInt, typename OutputIt,
1318
+
FMT_ENABLE_IF(is_back_insert_iterator<OutputIt>::value)>
1319
+
FMT_CONSTEXPR inline auto format_decimal(OutputIt out, UInt value, int size)
1320
+
-> format_decimal_result<OutputIt> {
1321
1321
// Buffer is large enough to hold all digits (digits10 + 1).
1322
1322
Char buffer[digits10<UInt>() + 1] = {};
1323
1323
auto end = format_decimal(buffer, value, size).end;
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@ TEST(compile_test, format_to_n) {
206
206
EXPECT_STREQ("2a", buffer);
207
207
}
208
208
209
-
# ifdef __cpp_lib_bit_cast
209
+
# if 0
210
210
TEST(compile_test, constexpr_formatted_size) {
211
211
FMT_CONSTEXPR20 size_t size = fmt::formatted_size(FMT_COMPILE("{}"), 42);
212
212
EXPECT_EQ(size, 2);
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4