Boost logo

Boost Users :

From: Dale Peakall (boost-users_at_[hidden])
Date: 2003-07-30 09:01:12


The following example is a very simple, and contrived, example that
demonstrates the problem I'm seeing.

This fails to compile with 'term does not evaluate to a function taking
1 arguments'.

Is this a problem with bind on MSVC 7.1, or have I just forgotton how to
use it/what it can do.

        - Dale.

#include <iostream>
#include <string>
#include <boost/bind.hpp>

int my_function(std::string const& value)
{
        return static_cast<int>(value.length());
}

int main()
{
        std::string my_string("hello world!");
        std::cout << boost::bind<int>(_1, my_string)(my_function);
}


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