Back to Arangodb

Approximate map between error code designs

3rdParty/boost/1.78.0/libs/outcome/doc/html/experimental/map.html

3.12.9.12.1 KB
Original Source

Approximate map between error code designs

Much of the design of Boost.System (which went on to become ) has been retained in proposed , so an approximate map between and and Boost.System can be given:

C++ 17 \Boost.SystemProposed \
std::errcboost::system::errcexperimental::errc (almost identical)
std::error_categoryboost::system::error_categoryexperimental::status_code_domain
std::generic_categoryboost::system::generic_categoryexperimental::generic_code_domain
std::system_categoryboost::system::system_categoryOne of:
  • experimental::posix_code_domain (POSIX systems)

  • experimental::win32_code_domain (Microsoft Windows)

  • experimental::nt_code_domain (Microsoft Windows)

Note that there are more precanned code categories though they require additional header inclusions: com_code, getaddrinfo_code. | | std::error_condition | boost::system::error_condition | No equivalent (deliberately removed as hindsight proved it to be a design mistake leading to much confusing and hard to audit for correctness code) | | std::error_code | boost::system::error_code | One of:

  • experimental::status_code<DomainType>

  • const experimental::status_code<void> &

  • experimental::status_code<erased<intptr_t>> (aliased to experimental::system_code)

  • experimental::errored_status_code<DomainType>

  • const experimental::errored_status_code<void> &

  • experimental::errored_status_code<erased<intptr_t>> (aliased to experimental::error)

The difference between status codes and errored status codes is that the latter are guaranteed to refer to a failure, whereas the former may refer to a success (including warnings and informationals). | | std::system_error | boost::system::system_error | One of:

  • const experimental::status_error<void> &

  • experimental::status_error<DomainType>

|

As is obvious from the above, in one must be much more specific and accurate with respect to intent and specification and desired semantics than with. Much ambiguity and incorrectness which flies silently in will refuse to compile in.