[Tinytl-general] function
Brought to you by:
egladysh
|
From: David L. <dle...@ya...> - 2003-12-10 19:51:21
|
Hello Eugene,
I saw your article in CodeProject, and downloaded
tinytl from SourceForge. I tried it out a bit and it
looks nice, however, regarding the "function"
object...
it would be nice if you could use non-static member
functions in addition to static member functions or
global functions.
For example:
class myListener
{
public:
static void static_event_callback( event& ev )
{
event_visitor v;
VAR::apply_visitor(v, ev);
}
void member_event_callback( event& ev )
{
event_visitor v;
VAR::apply_visitor(v, ev);
}
};
void global_event_callback( event& ev )
{
event_visitor v;
VAR::apply_visitor(v, ev);
}
main()
{
SIG::signal< void (event&) > sig;
// This works
// FUNC::function<void (event&)>
cb(global_event_callback);
// This works
FUNC::function<void (event&)>
cb(myListener::static_event_callback);
// Something like this would be nice
// myListener listener;
// FUNC::function<void (event&)>
cb(&listener,member_event_callback);
//
connection con = sig.connect( cb );
// ...
}
I was under the impression that Boost could do this.
Thanks,
Dave
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
|