Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++14 status.

2087.iostream_category() andnoexcept

Section: 31.5[iostreams.base]Status:C++14Submitter: Nicolai JosuttisOpened: 2011-09-22Last modified: 2016-01-28

Priority:Not Prioritized

View all otherissues in [iostreams.base].

View all issues withC++14 status.

Discussion:

In<system_error> we have:

const error_category& generic_category() noexcept;const error_category& system_category() noexcept;

In<future> we have:

const error_category& future_category() noexcept;

But in<ios> we have:

const error_category& iostream_category();

Is there any reason thatiostream_category() is not declared withnoexcept or is this an oversight?

Daniel:

This looks like an oversight to me. We made the abovementioned changes as part of noexcept-ifying the threadlibrary butiostream_category() was skipped, so it seemsto be forgotten. There should be no reason, why it cannotbenoexcept. When doing so, we should also make these functionsnoexcept (similar to corresponding overloads):

error_code make_error_code(io_errc e);error_condition make_error_condition(io_errc e);

Suggested wording provided by Daniel.

[2013-04-20, Bristol]

Unanimous.

Resolution: move to tentatively ready.

[2013-09-29, Chicago]

Apply to Working Paper

Proposed resolution:

This wording is relative to the FDIS.

  1. Change [iostreams.base.overview], header<ios> synopsis as indicated:

    #include <iosfwd>namespace std {  […]  error_code make_error_code(io_errc e)noexcept;  error_condition make_error_condition(io_errc e)noexcept;  const error_category& iostream_category()noexcept;}
  2. Change the prototype declarations in 31.5.6[error.reporting] as indicated:

    error_code make_error_code(io_errc e)noexcept;

    -1-Returns:error_code(static_cast<int>(e), iostream_category()).

    error_condition make_error_condition(io_errc e)noexcept;

    -2-Returns:error_condition(static_cast<int>(e), iostream_category()).

    const error_category& iostream_category()noexcept;

    -3-Returns: A reference to an object of a type derived from classerror_category.

    -4- The object’sdefault_error_condition andequivalent virtual functions shall behave as specifiedfor the classerror_category. The object’sname virtual function shall return a pointer to the string"iostream".


[8]ページ先頭

©2009-2026 Movatter.jp