Test and fix compiled format_to_n and formatted_size
This commit is contained in:
@@ -553,16 +553,15 @@ format_to_n_result<OutputIt> format_to_n(OutputIt out, size_t n,
|
||||
const CompiledFormat& cf,
|
||||
const Args&... args) {
|
||||
auto it =
|
||||
cf.format_to(internal::truncating_iterator<OutputIt>(out, n), args...);
|
||||
format_to(internal::truncating_iterator<OutputIt>(out, n), cf, args...);
|
||||
return {it.base(), it.count()};
|
||||
}
|
||||
|
||||
template <typename CompiledFormat, typename... Args>
|
||||
std::size_t formatted_size(const CompiledFormat& cf, const Args&... args) {
|
||||
return cf
|
||||
.format_to(
|
||||
internal::counting_iterator<typename CompiledFormat::char_type>(),
|
||||
args...)
|
||||
return fmt::format_to(
|
||||
internal::counting_iterator<typename CompiledFormat::char_type>(),
|
||||
cf, args...)
|
||||
.count();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user