#include #include class fiber { public: template fiber(F &&f, Args &&...args) { std::invoke(f, args...); } }; void funcion() { std::cout << "1\n"; } struct objeto { int a = 0; void operator()() { std::cout << "2\n"; } void metodo(int b) { std::cout << a + b << '\n'; } }; auto lambda = [] { std::cout << "3\n"; }; int main() { fiber f1(funcion), f2(objeto{}), f3(lambda), f4([] { std::cout << "4\n"; }), f5(&objeto::metodo, objeto{2}, 3); }