You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cdc1d40
Browse filesBrowse the repository at this point in the historyBrowse files
Colin Robertson
authored
Merge pull request #2962 from MicrosoftDocs/FromPublicMasterBranch
Copy file name to clipboardExpand all lines: docs/cpp/function-call-operator-parens.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,25 @@ no-loc: [ opt ]
7
7
---
8
8
# Function Call Operator: ()
9
9
10
-
A function call is a kind of *`postfix-expression`*, formed by an expression that identifies a function followed by the function-call operator, **`()`**. An object can declare an `operator ()` function, which provides function call semantics for the object.
10
+
A function call is a kind of *`postfix-expression`*, formed by an expression that evaluates to a function or callable object followed by the function-call operator, **`()`**. An object can declare an `operator ()` function, which provides function call semantics for the object.
The arguments to the function-call operator come from an *`argument-expression-list`*, a comma-separated list of expressions. The values of these expressions are passed to the function as arguments. The *argument-expression-list* can be empty. Before C++ 17, the order of evaluation of the function expression and the argument expressions is unspecified and may occur in any order. In C++17 and later, the function expression is evaluated before any argument expressions or default arguments. The argument expressions are evaluated in an indeterminate sequence.
20
20
21
-
The *`postfix-expression`*identifies the function to call. It must evaluate to a function address. It can take any of several forms:
21
+
The *`postfix-expression`*evaluates to the function to call. It can take any of several forms:
22
22
23
-
- a function or function object name or pointer,
24
-
- an lvalue expression that refers to a function or function object,
25
-
- a member function accessor, either explicit or implied.
23
+
- a function identifier, visible in the current scope or in the scope of any of the function arguments provided,
24
+
- an expression that evaluates to a function, a function pointer, a callable object, or to a reference to one,
25
+
- a member function accessor, either explicit or implied,
26
+
- a dereferenced pointer to a member function.
26
27
27
-
The function specified by the *`postfix-expression`* may be an overloaded function. The usual rules for overload resolution determine the actual function to call.
28
+
The *`postfix-expression`* may be an overloaded function identifier or overloaded member function accessor. The rules for overload resolution determine the actual function to call. If the member function is virtual, the function to call is determined at run time.
0 commit comments