Header file win32_code.hpp

#include "quick_status_code_from_enum.hpp"

namespace system_error2
{
    using win32_code = status_code<system_error2::_win32_code_domain>;

    using win32_error = status_error<system_error2::_win32_code_domain>;

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

    class _win32_code_domain;

    constexpr system_error2::_win32_code_domain const win32_code_domain;

    static constexpr system_error2::_win32_code_domain const& _win32_code_domain::get();

    namespace mixins
    {
        static system_error2::win32_code mixin<Base, system_error2::_win32_code_domain>::current() noexcept;
    }
}

Type alias system_error2::win32_code

using win32_code = status_code<system_error2::_win32_code_domain>;

(Windows only) A Win32 error code, those returned by GetLastError().


Type alias system_error2::win32_error

using win32_error = status_error<system_error2::_win32_code_domain>;

(Windows only) A specialisation of status_error for the Win32 error code domain.


Class system_error2::_win32_code_domain

class _win32_code_domain
: public status_code_domain
{
public:
    using value_type = 'hidden';

    constexpr _win32_code_domain(typename _base::unique_id_type id = 0x8cd18ee72d680f1b) noexcept;

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

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

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

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

    ~_win32_code_domain() = default;

    static constexpr system_error2::_win32_code_domain const& get();

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

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

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

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

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

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

(Windows only) The implementation of the domain for Win32 error codes, those returned by GetLastError().

Type alias system_error2::_win32_code_domain::value_type

using value_type = 'hidden';

The value type of the win32 code, which is a win32::DWORD


Constructor system_error2::_win32_code_domain::_win32_code_domain

constexpr _win32_code_domain(typename _base::unique_id_type id = 0x8cd18ee72d680f1b) noexcept;

Default constructor


Function system_error2::_win32_code_domain::get

static constexpr system_error2::_win32_code_domain const& get();

Constexpr singleton getter. Returns the constexpr win32_code_domain variable.



Variable system_error2::win32_code_domain

constexpr system_error2::_win32_code_domain const win32_code_domain;

(Windows only) A constexpr source variable for the win32 code domain, which is that of GetLastError() (Windows). Returned by _win32_code_domain::get().