[over.call.object]

# 12 Overloading [[over]](./#over)

## 12.2 Overload resolution [[over.match]](over.match#over.call.object)

### 12.2.2 Candidate functions and argument lists [[over.match.funcs]](over.match.funcs#over.call.object)

#### 12.2.2.2 Function call syntax [[over.match.call]](over.match.call#over.call.object)

#### 12.2.2.2.3 Call to object of class type [over.call.object]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L573)

If the [*postfix-expression*](expr.post.general#nt:postfix-expression "7.6.1.1 General [expr.post.general]") E in the function call syntax evaluates
to a class object of type âcv Tâ,
then the set of candidate functions
includes at least the function call operators of T[.](#1.sentence-1)

The function call operators of T are the results of a search for the name operator() in the scope of T[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L583)

In addition, for each non-explicit conversion function declared in T of the
form

operator [*conversion-type-id*](class.conv.fct#nt:conversion-type-id "11.4.8.3 Conversion functions [class.conv.fct]") ( ) [*cv-qualifier-seq*](dcl.decl.general#nt:cv-qualifier-seq "9.3.1 General [dcl.decl.general]")opt [*ref-qualifier*](dcl.decl.general#nt:ref-qualifier "9.3.1 General [dcl.decl.general]")opt [*noexcept-specifier*](except.spec#nt:noexcept-specifier "14.5 Exception specifications [except.spec]")opt [*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt ;

where the optional[*cv-qualifier-seq*](dcl.decl.general#nt:cv-qualifier-seq "9.3.1 General [dcl.decl.general]") is the same cv-qualification as, or a greater cv-qualification than,cv,
and where[*conversion-type-id*](class.conv.fct#nt:conversion-type-id "11.4.8.3 Conversion functions [class.conv.fct]") denotes the type âpointer to function
of (P1,â¦,Pn) returning Râ,
or the type âreference to pointer to function
of (P1,â¦,Pn) returning Râ,
or the type
âreference to function of (P1,â¦,Pn)
returning Râ, a [*surrogate call function*](#def:surrogate_call_function "12.2.2.2.3 Call to object of class type [over.call.object]") with the unique name*call-function* and having the form

R *call-function* ( [*conversion-type-id*](class.conv.fct#nt:conversion-type-id "11.4.8.3 Conversion functions [class.conv.fct]") F, P1 a1, …, Pn an) { return F (a1, …, an); }

is also considered as a candidate function[.](#2.sentence-1)

Similarly, surrogate
call functions are added to the set of candidate functions for
each non-explicit conversion function declared in a base class ofT provided the function is not hidden withinT by another
intervening declaration[.](#2.sentence-2)[102](#footnote-102 "Note that this construction can yield candidate call functions that cannot be differentiated one from the other by overload resolution because they have identical declarations or differ only in their return type. The call will be ambiguous if overload resolution cannot select a match to the call that is uniquely better than such undifferentiable functions.")

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L629)

The argument list submitted to overload resolution consists of
the argument expressions present in the function call syntax
preceded by the implied object argument(E)[.](#3.sentence-1)

[*Note [1](#note-1)*:

When comparing the
call against the function call operators, the implied object
argument is compared against the object parameter of the
function call operator[.](#3.sentence-2)

When comparing the call against a
surrogate call function, the implied object argument is compared
against the first parameter of the surrogate call function[.](#3.sentence-3)

â *end note*]

[*Example [1](#example-1)*: int f1(int);int f2(float);typedef int (*fp1)(int);typedef int (*fp2)(float);struct A {operator fp1() { return f1; }operator fp2() { return f2; }} a;int i = a(1); // calls f1 via pointer returned from conversion function â *end example*]

[102)](#footnote-102)[102)](#footnoteref-102)

Note that this construction can yield
candidate call functions that cannot be
differentiated one from the other by overload resolution because they have
identical
declarations or differ only in their return type[.](#footnote-102.sentence-1)

The call will be ambiguous
if overload
resolution cannot select a match to the call that is uniquely better than such
undifferentiable functions[.](#footnote-102.sentence-2)
