Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-11-12 08:40:57


Wang Yun wrote:
> Hi,
> I tried to bind to a class member function template, but can't pass
> compile, what's the correct syntax or this is impossible?
>
> class A
> {
> public:
> void test()
> {
> function<void()> func;
> func = boost::bind( &A::ttt<int>, this );
> }
>
> template<typename T>
> T ttt()
> {
> return 1;
> }
> };

This works under VC 8.0, but fails under VC 7.1. Use

    int (A::*pmf) () = &A::ttt<int>;
    func = boost::bind( pmf, this );


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