C++ Logo


Advanced search

The scope of the function-local predefined variable.

From: Vladimir Grigoriev <vlad.moscow_at_[hidden]>
Date: Thu, 08 Dec 2022 15:04:57 +0300
According to the C++ 20 Standard (Reference: 6.4.4 Function parameter scope)
«1 A function parameter (including one appearing in a lambda-declarator) or function-local predefined variable (9.5) has function parameter scope….»
So should this function declaration be valid?
void f( size_t n = sizeof __func__ );
At least from the C++ Standard it is unclear whether such a declaration is valid. Pay attention to that there is used a function declaration that is not the function definition.
With best regards
(Vlad from Moscow)
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com

Received on 2022-12-08 12:05:23