Fixed custom type example to work in c++11
This commit is contained in:
parent
ad08f13aac
commit
4fefd51e08
@ -262,12 +262,11 @@ struct my_type
|
|||||||
|
|
||||||
namespace fmt_lib = spdlog::fmt_lib;
|
namespace fmt_lib = spdlog::fmt_lib;
|
||||||
template<>
|
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(ctx.out(), "[my_type i={}]", my.i);
|
||||||
return fmt_lib::format_to(out, "[my_type i={}]", my.i);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user