Library feature: std::invoke

code

Syntax

Invoke gives a uniform way of calling methods and functions.

But why would we use this ?

Let’s try to call some class functions, assuming we have the following struct defined.

Before invoke:

After invoke:

This is pretty handy when you would like / need to call member functions.

Leave a comment

Your email address will not be published.