A RetroSearch Logo

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

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue2489 below:

Issue 2489: mem_fn() should be noexcept

This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.

2489. mem_fn() should be noexcept

Section: 22.10.16 [func.memfn] Status: C++17 Submitter: Stephan T. Lavavej Opened: 2015-03-27 Last modified: 2017-07-30

Priority: 0

View all other issues in [func.memfn].

View all issues with C++17 status.

Discussion:

mem_fn() is wide contract and doesn't do anything that could throw exceptions, so it should be marked noexcept.

Note that mem_fn() is perfectly happy to wrap a null PMF/PMD, it just can't be invoked later. This is exactly like std::function, which can be constructed from null PMFs/PMDs. Therefore, mem_fn() will remain wide contract forever.

[2015-05, Lenexa]

Move to Immediate.

Proposed resolution:

This wording is relative to N4296.

  1. Change 22.10 [function.objects] p2 "Header <functional> synopsis" as depicted:

    […]
    // 20.9.11, member function adaptors:
    template<class R, class T> unspecified mem_fn(R T::*) noexcept;
    […]
    
  2. Change 22.10.16 [func.memfn] as depicted:

    template<class R, class T> unspecified mem_fn(R T::* pm) noexcept;
    

    […]

    -4- Throws: Nothing.

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