C++ Logo

std-discussion

Advanced search

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

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Mon, 30 Oct 2023 09:32:02 +0200
On Mon, 30 Oct 2023 at 09:19, Simon Kraemer via Std-Discussion
<std-discussion_at_[hidden]> wrote:
>
> Isn't that what std::mem_fn is for?

No.

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

That would require a member function that is addressable, and none of
the non-virtual member functions in the standard library are.

Received on 2023-10-30 07:32:16