Fixed custom type example to work in c++11

This commit is contained in:
Gabi Melman 2021-12-11 17:07:10 +02:00 committed by GitHub
parent ad08f13aac
commit 4fefd51e08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,12 +262,11 @@ struct my_type
namespace fmt_lib = spdlog::fmt_lib;
template<>
struct fmt_lib::formatter<my_type> : fmt_lib::formatter<char>
struct fmt_lib::formatter<my_type> : fmt_lib::formatter<std::string>
{
auto format(my_type my, format_context &ctx)
auto format(my_type my, format_context &ctx) -> decltype(ctx.out())
{
auto &&out = ctx.out();
return fmt_lib::format_to(out, "[my_type i={}]", my.i);
return fmt_lib::format_to(ctx.out(), "[my_type i={}]", my.i);
}
};