SimpleKernel 1.17.0
Loading...
Searching...
No Matches
Error Struct Reference

错误类型,用于 std::expected More...

#include <expected.hpp>

Collaboration diagram for Error:
Collaboration graph

Public Member Functions

constexpr Error (ErrorCode c)
 
constexpr auto message () const -> const char *
 
构造/析构函数
 Error ()=default
 
 Error (const Error &)=default
 
 Error (Error &&)=default
 
auto operator= (const Error &) -> Error &=default
 
auto operator= (Error &&) -> Error &=default
 
 ~Error ()=default
 

Public Attributes

ErrorCode code {ErrorCode::kSuccess}
 

Detailed Description

错误类型,用于 std::expected

Definition at line 343 of file expected.hpp.

Constructor & Destructor Documentation

◆ Error() [1/4]

constexpr Error::Error ( ErrorCode  c)
inlineexplicitconstexpr

Definition at line 346 of file expected.hpp.

346: code(c) {}
ErrorCode code
Definition expected.hpp:344

◆ Error() [2/4]

Error::Error ( )
default

◆ Error() [3/4]

Error::Error ( const Error )
default

◆ Error() [4/4]

Error::Error ( Error &&  )
default

◆ ~Error()

Error::~Error ( )
default

Member Function Documentation

◆ message()

constexpr auto Error::message ( ) const -> const char*
inlineconstexpr

Definition at line 358 of file expected.hpp.

358 {
359 return GetErrorMessage(code);
360 }
constexpr auto GetErrorMessage(ErrorCode code) -> const char *
获取错误码对应的错误信息
Definition expected.hpp:141
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

auto Error::operator= ( const Error ) -> Error &=default
default

◆ operator=() [2/2]

auto Error::operator= ( Error &&  ) -> Error &=default
default

Member Data Documentation

◆ code

Definition at line 344 of file expected.hpp.


The documentation for this struct was generated from the following file: