A function produces a result, can be used as argument of another function parameter. So, is a function call like:
f(1,2,3)
be considered as an "expression"? Thanks.
A function produces a result, can be used as argument of another function parameter. So, is a function call like:
f(1,2,3)
be considered as an "expression"? Thanks.
The C++ standard (N3376, §5.1) specifies an expression as:
An expression is a sequence of operators and operands that specifies a computation. An expression can result in a value and can cause side effects.
Further in the same section (§5.2.2):
A function call is a postfix expression followed by parentheses containing a possibly empty, comma-separated list of expressions which constitute the arguments to the function.
In short, yes.
According to 5.2.2 [expr.call] paragraph 1 of ISO/IEC 14882:2014, a function call is a [postfix] expression:
A function call is a postfix expression followed by parentheses containing a possibly empty, comma-separated list of initializer-clauses which constitute the arguments to the function. ...
© 2022 - 2024 — McMap. All rights reserved.
postfix-expression
(function name) with aexpression-list
(arguments). See : msdn.microsoft.com/en-us/library/2az68d4d.aspx – Yare//
;-) – Lemley#
(yes, I'm trolling too). – Immiscible