Title
reference_wrapper::operator()'s Remark should be deleted
Status
c++17
Section
[refwrap.invoke]
Submitter
Stephan T. Lavavej

Created on 2014-10-01.00:00:00 last changed 81 months ago

Messages

Date: 2015-05-07.23:01:40

Proposed resolution:

This wording is relative to N3936.

  1. Change [refwrap.invoke] p2 as depicted:

    template <class... ArgTypes>
      result_of_t<T&(ArgTypes&&...)>
        operator()(ArgTypes&&... args) const;
    

    -1- Returns: INVOKE(get(), std::forward<ArgTypes>(args)...). (20.9.2)

    -2- Remark: operator() is described for exposition only. Implementations are not required to provide an actual reference_wrapper::operator(). Implementations are permitted to support reference_wrapper function invocation through multiple overloaded operators or through other means.

Date: 2015-05-07.23:01:40

[ 2015-05, Lenexa ]

DK: I don't see a defect here
STL: the issue is that the standard is overly verbose, we don't need this sentence. It's redundant.
MC: does anyone think this paragraph has value?
JW: it has negative value. reading it makes me wonder if there's some reason I would want to provide a set of overloaded functions, maybe there's some problem with doing it the obvious way that I'm not clever enough to see.
Move to Ready status: 8 in favor, none against.

Date: 2014-10-01.00:00:00

[refwrap.invoke]/2 is no longer useful. (It was originally TR1 2.1.2.4 [tr.util.refwrp.invoke]/2.) First, we already have the As If Rule ([intro.execution]/1) and the STL Implementers Can Be Sneaky Rule ([member.functions]). Second, with variadic templates and other C++11/14 tech, this can be implemented exactly as depicted.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2015-10-27 16:52:45adminsetstatus: ready -> wp
2015-05-07 23:01:40adminsetmessages: + msg7388
2015-05-07 23:01:40adminsetstatus: new -> ready
2014-10-07 20:00:37adminsetmessages: + msg7129
2014-10-01 00:00:00admincreate