move make_error_code overload into std
This commit is contained in:
parent
5bd23aa6ed
commit
a8b4aef168
10
src/main.cpp
10
src/main.cpp
|
@ -87,14 +87,14 @@ struct BoltErrorCategory : std::error_category {
|
||||||
|
|
||||||
const BoltErrorCategory boltCategory {};
|
const BoltErrorCategory boltCategory {};
|
||||||
|
|
||||||
std::error_code make_error_code(BoltErrc errc) {
|
|
||||||
return { static_cast<i32>(errc), boltCategory };
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <>
|
template <>
|
||||||
struct is_error_code_enum<BoltErrc> : true_type {};
|
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
|
/// 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,
|
/// 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.
|
/// 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());
|
lib = std::bit_cast<lightningbolt::BoltLibraryHeader*>(boltFile.GetMapping());
|
||||||
|
|
||||||
if(!lib->Validate())
|
if(!lib->Validate())
|
||||||
return make_error_code(BoltErrc::InvalidMagic);
|
return std::make_error_code(BoltErrc::InvalidMagic);
|
||||||
|
|
||||||
auto p = path;
|
auto p = path;
|
||||||
p.replace_filename("SLUS_201.14");
|
p.replace_filename("SLUS_201.14");
|
||||||
|
|
Loading…
Reference in New Issue