I can create a template class that stores some values in a property and let me later call a method that call a function with this arg. Like this :
template <
http://ideone.com/OPl7Rz
#include
#include
using namespace std;
template
void f(T... a)
{
std::initializer_list {(std::cout<
class Defer
{
private:
std::function func;
public:
Defer(T... a) : func(std::bind(f, a...)) {}
void call() {func();}
};
int main()
{
Defer d(1, 1.1, 2, "Hey");
d.call();
return 0;
}