File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -513,6 +513,8 @@ template <> struct formatter<std::error_code> {
513513 bool debug_ = false ;
514514
515515 public:
516+ FMT_CONSTEXPR void set_debug_format (bool set = true ) { debug_ = set; }
517+
516518 FMT_CONSTEXPR auto parse (parse_context<>& ctx) -> const char* {
517519 auto it = ctx.begin (), end = ctx.end ();
518520 if (it == end) return it;
Original file line number Diff line number Diff line change 1313#include < vector>
1414
1515#include " fmt/os.h" // fmt::system_category
16+ #include " fmt/ranges.h"
1617#include " gtest-extra.h" // StartsWith
1718
1819#ifdef __cpp_lib_filesystem
@@ -335,6 +336,10 @@ TEST(std_test, error_code) {
335336 EXPECT_EQ (fmt::format (" {:s}" , ec), ec.message ());
336337 EXPECT_EQ (fmt::format (" {:?}" , std::error_code (42 , generic)),
337338 " \" generic:42\" " );
339+ EXPECT_EQ (fmt::format (" {}" ,
340+ std::map<std::error_code, int >{
341+ {std::error_code (42 , generic), 0 }}),
342+ " {\" generic:42\" : 0}" );
338343}
339344
340345template <typename Catch> void exception_test () {
You can’t perform that action at this time.
0 commit comments