From d6fef8b171a93dd0f98aeeb40f54c742a8d9a789 Mon Sep 17 00:00:00 2001 From: talisein Date: Fri, 12 May 2023 16:43:06 -0700 Subject: [PATCH] Add const to std::formatter method (#260) --- include/magic_enum_format.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/magic_enum_format.hpp b/include/magic_enum_format.hpp index 99ce9d8..79b269f 100644 --- a/include/magic_enum_format.hpp +++ b/include/magic_enum_format.hpp @@ -55,7 +55,7 @@ namespace magic_enum::customize { template struct std::formatter && magic_enum::customize::enum_format_enabled(), char>> : std::formatter { - auto format(E e, format_context& ctx) { + auto format(E e, format_context& ctx) const { static_assert(std::is_same_v, "formatter requires string_view::value_type type same as char."); using D = std::decay_t;