Boost logo

Boost Users :

From: Duane Murphy (duanemurphy_at_[hidden])
Date: 2005-01-27 20:01:37


How do I work around this problem with bind?

#include <boost/bind.hpp>

namespace
{

class functions
{
public:
        int func( int );
        int func( int, int );
};

void test()
{
        functions a_func;
        
        boost::bind(
                functions::func, a_func, 1, _1 );
}

}

Bind can't determine which function to call because it is overloaded and
it doesn't know the context in which it will be called.

With CodeWarrior 8 on Mac OS X I get "illegal use of template argument
dependent type 'T::result_type'

It references an "unspecified" template deep in the bowels of bind.

As I recall there was some way of helping bind to pick one of the
overloaded functions using a typedef or something similar. (Maybe that
was function?).

Thanks for any tips,

 ...Duane


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