C++ Logo

std-discussion

Advanced search

Re: Addressability of the standard template function std::invoke.

From: Vladimir Grigoriev <vlad.moscow_at_[hidden]>
Date: Sat, 28 Oct 2023 20:43:53 +0300
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_at_[hidden]>:
>
>Am Sa., 28. Okt. 2023 um 19:12 Uhr schrieb Vladimir Grigoriev via
>Std-Discussion < std-discussion_at_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
 

Received on 2023-10-28 17:44:03