Re: [LAD] again [ot] programming c++ problem (functions adresses)

From: Dominic Sacré <dominic.sacre@email-addr-hidden>
Date: Mon Jul 16 2007 - 21:56:59 EEST

> You need something like std::mem_fun. Have you looked at Boost
> (http://www.boost.org)? I think boost::mem_fn will do what you want.

Unfortunately that won't work. std::mem_fun and boost::mem_fn create
functors which can be used with STL algorithms and the like, but are
completely different from C functions (or function pointers). The way
they are used looks similar, but it's not the same thing.

There simply is no pretty solution to this problem, you'll have to use
a global (or static member) function in some way...

> You could also cobble something together on your own. If your
> Midish_rl class is a singleton (i.e. you only allocate one object of
> that type in you program), you could add some static wrapper methods.
> Otherwise, write your own member function adapters classes specific to
> your situation.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-dev
Received on Tue Jul 17 00:15:04 2007

This archive was generated by hypermail 2.1.8 : Tue Jul 17 2007 - 00:15:04 EEST