- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
#include <iostream>
#include <type_traits>
#include <functional>
template <typename Function, typename... Args>
auto call(Function function, Args&&... args) {
return std::move(function)(std::forward<Args>(args)...);
}
class Foo {
public:
void say(int a) const { std::cout << "Foo::say(int a = " << a << ")\n"; }
};
int main() {
call(std::mem_fn(&Foo::say), Foo(), 42);
}
ASD_77 28.07.2017 16:36 # 0
AnalPerOral 29.07.2017 16:12 # −2