$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: raulh39_at_[hidden]
Date: 2006-02-03 12:19:33
Stephen Gross wrote:
>I'm trying to figure out the correct syntax for
boost::bind-ing a static
>member function with some arguments preset. ...
>
>
This code works for me:
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <iostream>
struct Foo
{
static double go(int x, int y) { return x + y; }
};
int main()
{
typedef boost::function<double(int)> functortype;
functortype f = boost::bind(&Foo::go, _1, 4);
std::cout << f(3) << std::endl;
}
Hope it helps.