move make_error_code overload into std

This commit is contained in:
Lily Tsuru 2023-11-19 20:57:04 -05:00
parent 5bd23aa6ed
commit a8b4aef168
1 changed files with 5 additions and 5 deletions

View File

@ -87,14 +87,14 @@ struct BoltErrorCategory : std::error_category {
const BoltErrorCategory boltCategory {};
std::error_code make_error_code(BoltErrc errc) {
return { static_cast<i32>(errc), boltCategory };
}
namespace std {
template <>
struct is_error_code_enum<BoltErrc> : true_type {};
std::error_code make_error_code(BoltErrc errc) {
return { static_cast<i32>(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<lightningbolt::BoltLibraryHeader*>(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");