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

### 658. Two unspecified function comparators in [function.objects]

Section: 20.14 [function.objects] Status: Resolved Submitter: Daniel Krügler Opened: 2007-03-19 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [function.objects].

View all issues with Resolved status.

Discussion:

The header `<functional>` synopsis in 20.14 [function.objects] contains the following two free comparison operator templates for the `function` class template

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

which are nowhere described. I assume that they are relicts before the corresponding two private and undefined member templates in the function template (see 20.14.17.3 [func.wrap.func] and [func.wrap.func.undef]) have been introduced. The original free function templates should be removed, because using an undefined entity would lead to an ODR violation of the user.

Proposed resolution:

Remove the above mentioned two function templates from the header `<functional>` synopsis (20.14 [function.objects])

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

Rationale:

Fixed by N2292 Standard Library Applications for Deleted Functions.