-
Notifications
You must be signed in to change notification settings - Fork 506
Closed
Description
Good day
Unfortunately we cannot leverage the power of std::format
just yet as we're stuck on ubuntu 22.04 for now.
However, libfmt is the predecesor of this format. Supporting this can be done easily with this snippet:
#include <fmt/format.h>
#include <magic_enum.hpp>
template <typename E>
struct fmt::formatter<E, std::enable_if_t<std::is_enum_v<E>, char>> : fmt::formatter<std::string_view, char> {
auto format(E e, format_context& ctx)
{
return formatter<string_view>::format(magic_enum::enum_name(e), ctx);
}
};
Could this perhaps be included in this wonderful library? Similar to the std::format
perhaps?
Metadata
Metadata
Assignees
Labels
No labels