Files
2025-10-25 03:02:53 +03:00

35 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[over.call]
# 12 Overloading [[over]](./#over)
## 12.4 Overloaded operators [[over.oper]](over.oper#over.call)
### 12.4.4 Function call [over.call]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/overloading.tex#L3622)
A [*function call operator function*](#def:operator_function,function_call "12.4.4Function call[over.call]") is a function named operator() that is a member function with an arbitrary number of parameters[.](#1.sentence-1)
It may have default arguments[.](#1.sentence-2)
For an expression of the form
[*postfix-expression*](expr.post.general#nt:postfix-expression "7.6.1.1General[expr.post.general]") ( [*expression-list*](expr.post.general#nt:expression-list "7.6.1.1General[expr.post.general]")opt )
where the [*postfix-expression*](expr.post.general#nt:postfix-expression "7.6.1.1General[expr.post.general]") is of class type,
the operator function
is selected by overload resolution ([[over.call.object]](over.call.object "12.2.2.2.3Call to object of class type"))[.](#1.sentence-3)
If a surrogate call function is selected,
let e be the result of invoking the corresponding conversion operator function on the [*postfix-expression*](expr.post.general#nt:postfix-expression "7.6.1.1General[expr.post.general]");
the expression is interpreted as
e ( [*expression-list*](expr.post.general#nt:expression-list "7.6.1.1General[expr.post.general]")opt )
Otherwise, the expression is interpreted as
[*postfix-expression*](expr.post.general#nt:postfix-expression "7.6.1.1General[expr.post.general]") . operator () ( [*expression-list*](expr.post.general#nt:expression-list "7.6.1.1General[expr.post.general]")opt )