From a8b4aef16821bbaf5bfe0a0393b64ce9b8f17f0e Mon Sep 17 00:00:00 2001 From: modeco80 Date: Sun, 19 Nov 2023 20:57:04 -0500 Subject: [PATCH] move make_error_code overload into std --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c6f2e62..01ad3e1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -87,14 +87,14 @@ struct BoltErrorCategory : std::error_category { const BoltErrorCategory boltCategory {}; -std::error_code make_error_code(BoltErrc errc) { - return { static_cast(errc), boltCategory }; -} - namespace std { template <> struct is_error_code_enum : true_type {}; + std::error_code make_error_code(BoltErrc errc) { + return { static_cast(errc), boltCategory }; + } + /// Custom formatter for std::error_code. As far as I know, this is /// Not going to be added in C++23, despite the fact fmt already has a specialization for it, /// so I have to implement one myself. At least it's not that awful to. @@ -140,7 +140,7 @@ struct BoltReader { lib = std::bit_cast(boltFile.GetMapping()); if(!lib->Validate()) - return make_error_code(BoltErrc::InvalidMagic); + return std::make_error_code(BoltErrc::InvalidMagic); auto p = path; p.replace_filename("SLUS_201.14");