Title
When are default arguments evaluated?
Status
c++14
Section
9.3.4.7 [dcl.fct.default]
Submitter
David Krauss

Created on 2013-07-17.00:00:00 last changed 122 months ago

Messages

Date: 2014-02-15.00:00:00

[Moved to DR at the February, 2014 meeting.]

Date: 2014-01-15.00:00:00

Proposed resolution (January, 2014):

Change 9.3.4.7 [dcl.fct.default] paragraph 9 as follows:

Default arguments are A default argument is evaluated each time the function is called with no argument for the corresponding parameter. The order of evaluation...
Date: 2013-07-17.00:00:00

According to 9.3.4.7 [dcl.fct.default] paragraph 9,

Default arguments are evaluated each time the function is called.

Obviously, what was intended by this is that the default argument is evaluated only if no corresponding actual argument is provided, but this could be read as indicating that the default argument is evaluated and discarded by every function call.

History
Date User Action Args
2014-11-24 00:00:00adminsetstatus: dr -> c++14
2014-03-03 00:00:00adminsetmessages: + msg4950
2014-03-03 00:00:00adminsetstatus: tentatively ready -> dr
2014-01-20 00:00:00adminsetmessages: + msg4730
2014-01-20 00:00:00adminsetstatus: drafting -> tentatively ready
2013-10-14 00:00:00adminsetstatus: open -> drafting
2013-07-17 00:00:00admincreate