Header file std_error_code.hpp

#include "posix_code.hpp"

#include "win32_code.hpp"

namespace system_error2
{
    using std_error_code = status_code<system_error2::_std_error_code_domain>;

    namespace mixins
    {
        template <class Base>
        struct mixin<Base, _std_error_code_domain>;
    }

    class _std_error_code_domain final;

    namespace mixins
    {
        mixin<Base, system_error2::_std_error_code_domain>::mixin(std::error_code ec);

        std::error_category const& mixin<Base, system_error2::_std_error_code_domain>::category() const noexcept;

        ;
    }

    static system_error2::_std_error_code_domain const* _std_error_code_domain::get(std::error_code ec);

    virtual bool _std_error_code_domain::_do_failure(status_code<void> const& code) const noexcept;

    virtual bool _std_error_code_domain::_do_equivalent(status_code<void> const& code1, status_code<void> const& code2) const noexcept;

    virtual system_error2::generic_code _std_error_code_domain::_generic_code(status_code<void> const& code) const noexcept;

    virtual _std_error_code_domain::string_ref _std_error_code_domain::_do_message(status_code<void> const& code) const noexcept;

    virtual void _std_error_code_domain::_do_throw_exception(status_code<void> const& code) const;
}

namespace std
{
    system_error2::std_error_code make_status_code(std::error_code c) noexcept;
}

Type alias system_error2::std_error_code

using std_error_code = status_code<system_error2::_std_error_code_domain>;

A status_code representing exactly a std::error_code


Class system_error2::_std_error_code_domain

class _std_error_code_domain final
: public status_code_domain
{
public:
    using value_type = int;

    'hidden'& error_category() const noexcept;

    explicit _std_error_code_domain('hidden' const& category) noexcept;

    _std_error_code_domain(system_error2::_std_error_code_domain const&) = default;

    _std_error_code_domain(system_error2::_std_error_code_domain&&) = default;

    system_error2::_std_error_code_domain& operator=(system_error2::_std_error_code_domain const&) = default;

    system_error2::_std_error_code_domain& operator=(system_error2::_std_error_code_domain&&) = default;

    ~_std_error_code_domain() = default;

    static system_error2::_std_error_code_domain const* get('hidden' ec);

    virtual system_error2::status_code_domain::string_ref name() const noexcept;

protected:
    virtual bool _do_failure(status_code<void> const& code) const noexcept override;

    virtual bool _do_equivalent(status_code<void> const& code1, status_code<void> const& code2) const noexcept override;

    virtual system_error2::generic_code _generic_code(status_code<void> const& code) const noexcept override;

    virtual system_error2::status_code_domain::string_ref _do_message(status_code<void> const& code) const noexcept override;

    virtual void _do_throw_exception(status_code<void> const& code) const override;
};

The implementation of the domain for std::error_code error codes.

Type alias system_error2::_std_error_code_domain::value_type

using value_type = int;

The value type of the std::error_code code, which stores the int from the std::error_code


Function system_error2::_std_error_code_domain::error_category

'hidden'& error_category() const noexcept;

Returns the error category singleton pointer this status code domain represents


Constructor system_error2::_std_error_code_domain::_std_error_code_domain

explicit _std_error_code_domain('hidden' const& category) noexcept;

Default constructor