Boost logo

Boost :

From: Jared McIntyre (jmcintyre_at_[hidden])
Date: 2006-08-30 18:30:37

I'm sure I'm missing something pretty fundamental here. I'm trying to set a boost::function to a member function
without any parameters. The following code fails to build (using VS 2005, haven't tested anything else). If I set it
to a non-member function it works fine.

#include <functional>
#include <boost/function.hpp>

class test
        int GetInt()
                return 1;

int _tmain(int argc, _TCHAR* argv[])
        test inst;
        boost::function<int ()> getter;

         // Getting several errors where it appears that <int ()> isn't being handled
         // as a signature when being handled by mem_fun. Not sure whether that is related.
        getter = std::bind1st( std::mem_fun(&test::GetInt), &inst);

        return 0;

Boost list run by bdawes at, gregod at, cpdaniel at, john at