3.6 KiB
[basic.scope.param]
6 Basics [basic]
6.4 Scope [basic.scope]
6.4.4 Function parameter scope [basic.scope.param]
A parameter-declaration-clause P introduces a function parameter scope that includes P.
[Note 1:
A function parameter cannot be used for its value within the parameter-declaration-clause ([dcl.fct.default]).
â end note]
-
If P is associated with a declarator and is preceded by a (possibly-parenthesized) noptr-declarator of the formdeclarator-id attribute-specifier-seqopt, its scope extends to the end of the nearest enclosinginit-declarator,member-declarator,declarator of a parameter-declaration or a nodeclspec-function-declaration, orfunction-definition, but does not include the locus of the associated declarator. [Note 2: In this case, P declares the parameters of a function (or a function or template parameter declared with function type). A member function's parameter scope is nested within its class's scope. â end note]
-
If P is associated with a lambda-declarator, its scope extends to the end of the compound-statement in the lambda-expression.
-
If P is associated with a requirement-parameter-list, its scope extends to the end of the requirement-body of the requires-expression.
-
If P is associated with a deduction-guide, its scope extends to the end of the deduction-guide.