Thanks.
 
It would be much simpler just to specify std::invoke.:)
 
In my opinion it is a drawback of the standard.:)
 
 
 
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
 
 
Суббота, 28 октября 2023, 20:31 +03:00 от Daniel Krügler <daniel.kruegler@gmail.com>:
 
Am Sa., 28. Okt. 2023 um 19:12 Uhr schrieb Vladimir Grigoriev via
Std-Discussion <std-discussion@lists.isocpp.org>:
>
> I read ( en.cppreference.com/w/cpp/language/) that standard functions are not addressable except some limited number of functions. Otherwise the behavior either undefined or unspecified.
>
> May the function std::invoke be used as shown below?

No. Basically only IO manipulator functions are addressable functions
in the Standard Library.

> std::for_each( std::begin( v ), std::end( v ), std::invoke<std::function<void()> &> );

Why not using a lambda expression instead?

- Daniel