Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-12-20


1973. Whichparameter-declaration-clause in alambda-expression?

Section:7.5.6.2  [expr.prim.lambda.closure]    Status:CD7    Submitter:Dinka Ranns    Date:2014-07-16

[Accepted as a DR at the June, 2023 meeting.]

According to 7.5.6.2 [expr.prim.lambda.closure] paragraph 3,

The closure type for alambda-expression has a public inlinefunction call operator (for a non-generic lambda) or function calloperator template (for a generic lambda) (12.4.4 [over.call])whose parameters and return type are described bythelambda-expression'sparameter-declaration-clauseandtrailing-return-type respectively, andwhosetemplate-parameter-list consists of thespecifiedtemplate-parameter-list, if any.

This is insufficiently precise because thetrailing-return-typemight itself contain aparameter-declaration-clause.

Suggested resolution [SUPERSEDED]:

Change in 7.5.6.1 [expr.prim.lambda.general] paragraph 5 as follows:

Ifalambda-declarator does notinclude astart with a parenthesizedparameter-declaration-clause, it is as if() wereinserted at the start of thelambda-declarator.Alambda-expression'sparameter-declaration-clauseis the (possibly empty)parameter-declaration-clause ofthelambda-expression'slambda-declarator.If thelambda-declarator does not includeatrailing-return-type, the lambda return type is auto, whichis deduced from return statements as described in9.2.9.7 [dcl.spec.auto].

Proposed resolution (approved by CWG 2023-02-06):

  1. Change in 7.5.6.2 [expr.prim.lambda.closure] paragraph 3 as follows:

    The closure type for alambda-expression has a public inlinefunction call operator (for a non-generic lambda) or function calloperator template (for a generic lambda) (12.4.4 [over.call])whose parameters and return type aredescribed bythose ofthelambda-expression'sparameter-declaration-clauseandtrailing-return-type respectively, andwhosetemplate-parameter-list consists of thespecifiedtemplate-parameter-list, if any.
  2. Change in 7.5.6.1 [expr.prim.lambda.general] paragraph 5 as follows:

    If alambda-declarator does not includeaparameter-declaration-clause, it is as if() wereinserted at the start of thelambda-declarator.Alambda-expression'sparameter-declaration-clauseis theparameter-declaration-clause ofthelambda-expression'slambda-declarator, if any, or empty otherwise.If thelambda-declarator does not includeatrailing-return-type, the lambda return type is auto, whichis deduced from return statements as described in9.2.9.7 [dcl.spec.auto].



[8]ページ先頭

©2009-2026 Movatter.jp