mirror of
https://github.com/fmtlib/fmt.git
synced 2025-10-27 12:11:44 +01:00
Use buffering in to_string to avoid bloat
This commit is contained in:
@@ -1970,8 +1970,7 @@ template <typename, typename OutputIt> void write(OutputIt, foo) = delete;
|
||||
FMT_BEGIN_NAMESPACE
|
||||
template <>
|
||||
struct formatter<adl_test::fmt::detail::foo> : formatter<std::string> {
|
||||
template <typename FormatContext>
|
||||
auto format(adl_test::fmt::detail::foo, FormatContext& ctx)
|
||||
auto format(adl_test::fmt::detail::foo, format_context& ctx)
|
||||
-> decltype(ctx.out()) {
|
||||
return formatter<std::string>::format("foo", ctx);
|
||||
}
|
||||
@@ -1979,9 +1978,7 @@ struct formatter<adl_test::fmt::detail::foo> : formatter<std::string> {
|
||||
FMT_END_NAMESPACE
|
||||
|
||||
struct convertible_to_int {
|
||||
operator int() const { return value; }
|
||||
|
||||
int value = 42;
|
||||
operator int() const { return 42; }
|
||||
};
|
||||
|
||||
TEST(format_test, to_string) {
|
||||
|
||||
Reference in New Issue
Block a user