mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 08:25:43 +08:00
Fixed example for custom_type
This commit is contained in:
parent
2c21d9ecf8
commit
b8b16e49a5
@ -260,12 +260,13 @@ struct my_type
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace fmt_lib = spdlog::fmt_lib;
|
||||||
template<>
|
template<>
|
||||||
struct spdlog::fmt_lib::formatter<my_type> : spdlog::fmt_lib::formatter<std::string>
|
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)
|
||||||
{
|
{
|
||||||
return formatter<std::string>::format(spdlog::fmt_lib::format("[my_type i={}]", my.i), ctx);
|
return formatter<std::string>::format(fmt_lib::format("[my_type i={}]", my.i), ctx);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user