A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/syserr.errcode below:

[syserr.errcode]

22 Diagnostics library [diagnostics] 22.5 System error support [syserr] 22.5.3 Class error_­code [syserr.errcode] 22.5.3.1 Class error_­code overview [syserr.errcode.overview]

The class error_­code describes an object used to hold error code values, such as those originating from the operating system or other low-level application program interfaces. [Note: Class error_­code is an adjunct to error reporting by exception. end note]

namespace std {
  class error_code {
  public:
        error_code() noexcept;
    error_code(int val, const error_category& cat) noexcept;
    template <class ErrorCodeEnum>
      error_code(ErrorCodeEnum e) noexcept;

        void assign(int val, const error_category& cat) noexcept;
    template <class ErrorCodeEnum>
      error_code& operator=(ErrorCodeEnum e) noexcept;
    void clear() noexcept;

        int value() const noexcept;
    const error_category& category() const noexcept;
    error_condition default_error_condition() const noexcept;
    string message() const;
    explicit operator bool() const noexcept;

  private:
    int val_;                       const error_category* cat_;   };

    error_code make_error_code(errc e) noexcept;

  template <class charT, class traits>
    basic_ostream<charT, traits>&
      operator<<(basic_ostream<charT, traits>& os, const error_code& ec);
}
22.5.3.2 Class error_­code constructors [syserr.errcode.constructors]

error_code() noexcept;

Effects: Constructs an object of type error_­code.

Postconditions: val_­ == 0 and cat_­ == &system_­category().

error_code(int val, const error_category& cat) noexcept;

Effects: Constructs an object of type error_­code.

Postconditions: val_­ == val and cat_­ == &cat.

template <class ErrorCodeEnum> error_code(ErrorCodeEnum e) noexcept;

Effects: Constructs an object of type error_­code.

Postconditions: *this == make_­error_­code(e).

Remarks: This constructor shall not participate in overload resolution unless
is_­error_­code_­enum_­v<ErrorCodeEnum> is true.

22.5.3.3 Class error_­code modifiers [syserr.errcode.modifiers]

void assign(int val, const error_category& cat) noexcept;

Postconditions: val_­ == val and cat_­ == &cat.

template <class ErrorCodeEnum> error_code& operator=(ErrorCodeEnum e) noexcept;

Postconditions: *this == make_­error_­code(e).

Remarks: This operator shall not participate in overload resolution unless
is_­error_­code_­enum_­v<ErrorCodeEnum> is true.

void clear() noexcept;

Postconditions: value() == 0 and category() == system_­category().

22.5.3.4 Class error_­code observers [syserr.errcode.observers]

int value() const noexcept;

const error_category& category() const noexcept;

error_condition default_error_condition() const noexcept;

Returns: category().default_­error_­condition(value()).

string message() const;

Returns: category().message(value()).

explicit operator bool() const noexcept;

22.5.3.5 Class error_­code non-member functions [syserr.errcode.nonmembers]

error_code make_error_code(errc e) noexcept;

Returns: error_­code(static_­cast<int>(e), generic_­category()).

template <class charT, class traits> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const error_code& ec);

Effects: As if by: os << ec.category().name() << ':' << ec.value();


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4