diff --git a/src/error.cpp b/src/error.cpp index 1a3038f..69706fc 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -6,7 +6,9 @@ namespace cmkr::error { Status::Status(Code ec) noexcept : ec_(ec) {} -Status::operator int() noexcept { return static_cast(ec_); } +Status::operator int() const noexcept { return static_cast(ec_); } + +Status::Code Status::code() const noexcept { return ec_; } } // namespace cmkr::error diff --git a/src/error.h b/src/error.h index dae2227..80c2150 100644 --- a/src/error.h +++ b/src/error.h @@ -12,7 +12,8 @@ struct Status { BuildError, }; Status(Code ec) noexcept; - operator int() noexcept; + operator int() const noexcept; + Code code() const noexcept; private: Code ec_ = Code::Success;