644. Possible typos in 'function' description

Section: 22.10.17.3 [func.wrap.func] Status: NAD Submitter: Bo Persson Opened: 2007-02-25 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [func.wrap.func].

View all issues with NAD status.

Discussion:

22.10.17.3 [func.wrap.func]

The note in paragraph 2 refers to 'undefined void operators', while the section declares a pair of operators returning bool.

[ Post-Sophia Antipolis: ]

Changed from Pending WP to Open. This issue was voted to WP at the same time the operators were changed from private to deleted. The two issues stepped on each other. What do we want the return type of these deleted functions to be?

[ 2009-05-02 Daniel adds: ]

I suggest harmonizing this issue with similar classes. E.g. in 20.3.2.3 [util.smartptr.weak] bool return values for

template <class Y> bool operator<(weak_ptr<Y> const&) const = delete;
template <class Y> bool operator<=(weak_ptr<Y> const&) const = delete;
template <class Y> bool operator>(weak_ptr<Y> const&) const = delete;
template <class Y> bool operator>=(weak_ptr<Y> const&) const = delete;

are used and basically all newer provided deleted copy assignment operators of type X use the canonical return type X& instead of void. Since the note mentioned in the issue description has now already been changed to

deleted overloads close possible hole in the type system

it seems to be of even lesser need to perform the change. Therefore I recommend declaring the issue as NAD.

[ Batavia (2009-05): ]

We agree with Daniel's recommendation.

Move to NAD.

Proposed resolution:

Change 22.10.17.3 [func.wrap.func]

...
private:
   // 22.10.17.3 [func.wrap.func], undefined operators:
   template<class Function2> bool void operator==(const function<Function2>&);
   template<class Function2> bool void operator!=(const function<Function2>&);
};

Change 22.10.17.3 [func.wrap.func]

template<class Function2> bool void operator==(const function<Function2>&);
template<class Function2> bool void operator!=(const function<Function2>&);