P
Pelle Beckman
Does C++ in some way support anonymous functions?
Say I have a callback function that I register
with SetCallback() (this perticular example
is from my attempts at messages, signals, events, etc
in a GUI for a game)
Would something in this way be possible:
(I know Java can do it...)
SetCallback (new function() = {
my_var++;
std::cout << "Hello!" << std::endl;
});
Thanks!
-- Pelle
Say I have a callback function that I register
with SetCallback() (this perticular example
is from my attempts at messages, signals, events, etc
in a GUI for a game)
Would something in this way be possible:
(I know Java can do it...)
SetCallback (new function() = {
my_var++;
std::cout << "Hello!" << std::endl;
});
Thanks!
-- Pelle