C++ Logo

std-discussion

Advanced search

Addressability of the standard template function std::invoke.

From: Vladimir Grigoriev <vlad.moscow_at_[hidden]>
Date: Sat, 28 Oct 2023 20:12:26 +0300
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?
 
std::for_each( std::begin( v ), std::end( v ), std::invoke<std::function<void()> &> );
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 2023-10-28 17:12:35