Event test{[](){MessageBox("hello world");}}
i get these error message: "invalid use of template-name 'Event' without an argument list"
i thot that i was doing rigth with: template<typename...a>
what i'm doing wrong?
my objective is accept any or more parameters
maybe was you that said that i must do these(for be empty or something): test=[](int, int){;};
but the 'if' calls it anyway:
1 2 3
std::function<void()> test=[](int, int){;};;
if(test) // Note: the operator bool tells whether the function is valid or not
test();
that's true don't do anything, but calls it.
so the 'if' only test if the 'test' is good for call nothing more, right?
seen again.. sorry. i read, again the comment.
thaks for all
yes it is, by several reasons:
1 - it's more easy create the lambda;
2 - always test before call it...
well the only problem is that i can't change it on General Area, only create it and inicializate it.
"Consider the effects within your program. Where I don't have the overview."
maybe you are warning me something, but i don't see the bad thing.
error message: "could not convert '<lambda closure object>Timer::__lambda4{}' from 'Timer::__lambda4' to 'Event<>'"
i don't know what means these error... can you explain better?
i did. so see these Timer sample\object: Timer tmrCreate{[&](){Create();}};
error: could not convert '{<lambda closure object>consolewindow::__lambda144{((consolewindow*)this)}}' from '<brace-enclosed initializer list>' to 'Timer'
why these error?