#include namespace lightningbolt { namespace { struct BoltErrorCategory : std::error_category { const char* name() const noexcept override { return "bolt"; } std::string message(i32 ev) const override { switch(static_cast(ev)) { case BoltErrc::InvalidMagic: return "Invalid bolt library file magic"; case BoltErrc::DecompressionError: return "Error during BOLT file decompression"; default: return "Unknown error"; } } }; } // namespace const BoltErrorCategory boltCategory {}; } // namespace lightningbolt namespace std { std::error_code make_error_code(::lightningbolt::BoltErrc errc) { return { static_cast(errc), ::lightningbolt::boltCategory }; } } // namespace std