[boost] Re: Any interest in a member function pointer -> functionpointerconverter? (a la boost::function)

2003-06-06 Thread Pavel Vozenilek
"Terje Slettebø" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [snip] > int main() > { > function_ptr fn; > > // The rest the same > > A a; > int r=fn(&a, 3); // sets r to 9 > } > Is it similar (in principle) to http://www.code-genie.com/cpp/articles/events/events.html (long

[boost] Re: Any interest in a member function pointer -> functionpointerconverter? (a la boost::function)

2003-06-06 Thread Bohdan
IMHO a very useful addon to your library can be routine to convert class to function which calls class destructor. template < typename T > void destruct( void * buf ) { reinterpret_cast(buf)->~T(); } typedef void (*destruct_fn_type)( void * buf ); //like following, b

Re: [boost] Re: Any interest in a member function pointer ->functionpointerconverter? (a la boost::function)

2003-06-06 Thread Terje Slettebø
>From: "Pavel Vozenilek" <[EMAIL PROTECTED]> > "Terje Slettebø" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > [snip] > > > int main() > > { > > function_ptr fn; > > > > // The rest the same > > > > A a; > > int r=fn(&a, 3); // sets r to 9 > > } > > > Is it similar (in pri

Re: [boost] Re: Any interest in a member function pointer ->functionpointerconverter? (a la boost::function)

2003-06-06 Thread Terje Slettebø
>From: "Bohdan" <[EMAIL PROTECTED]> > IMHO a very useful addon to your library can be routine > to convert class to function which calls class destructor. > //no virtual functions, no runtime polymorphism > void * ptr = new MyClass; > destruct_fn_type df = destruct_fn();