Boost logo

Boost Users :

From: James Hughes (JHughes_at_[hidden])
Date: 2006-04-11 12:04:25


Sorry that should read

"boost.function does NOT (....." amongst other bad spelling mistakes...

James

> -----Original Message-----
> From: James Hughes [mailto:JHughes_at_[hidden]]
> Sent: 11 April 2006 17:01
> To: 'boost-users_at_[hidden]'
> Subject: Re: [Boost-users] Changing name of function being called in a
> tem plate
>
>
> >Have you checked out Boost.Function? You can use a
> >boost::function<void (T &)>
> >instance in your class to point to the correct member
> function you want
> >to call.
> >
> >Alternatively, you may try to use member function pointer:
> >
> >template <typename T, void (Observer::*Notify)(T & )>
> >class ....
> >{ }
> >
> >Just my 5 cents...
> >
> >Cheers,
> >
> >Freddie
>
> Thanks Freddie,
>
> boost.function does allows me (I dont think) to specify the
> function when
> the template is instantiated (it has to be done programmatically). The
> alterantive might, but I am unsure of the syntax and how to
> use it - could
> you add any detail?
>
> At the moment, it seems like a robust option is to use
> macros, and simply
> redefine the function name to whatever I want - quick and
> simple, but not
> very templatey!!
>
> James
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net