mem_fn() should be noexcept
Stephan T. Lavavej

Created on 2015-03-27.00:00:00 last changed 74 months ago


Date: 2015-05-07.19:30:46

Proposed resolution:

This wording is relative to N4296.

  1. Change [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 [func.memfn] as depicted:

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


    -4- Throws: Nothing.

Date: 2015-05-07.19:30:46

[ 2015-05, Lenexa ]

Move to Immediate.

Date: 2015-03-27.00:00:00

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.

Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2015-10-27 16:52:45adminsetstatus: ready -> wp
2015-05-20 14:24:57adminsetstatus: immediate -> ready
2015-05-07 19:30:46adminsetmessages: + msg7371
2015-05-07 19:30:46adminsetstatus: new -> immediate
2015-04-03 16:54:18adminsetmessages: + msg7323
2015-03-27 00:00:00admincreate