So, i am upgrading my logs library to spdlog, at first i had an issue with enum formatting and i solved it.. then i got errors because it can’t format pointers
This is how i solved enum formatting issue..
template<typename T> requires std::is_enum_v<T> auto format_as(T t) { return fmt::underlying(t); }
Then i tried same way for pointer formatting
template<typename T> requires std::is_pointer_v<T> auto format_as(T ptr) { return fmt::ptr(ptr); }
How evver, enum formatting works.. and i dont need to do anything..
But pointer formatting not work and it always gibe me compile errors.. Why pointer formatting not works in this way as enum?
I am using latest spdlog and latest fmt, and both header only.. and fmt external for spdlog
Dixi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.