Boost logo

Boost Users :

From: Cheenu Srinivasan (cheenu_srinivasan_at_[hidden])
Date: 2004-02-03 12:16:06


The following program throws a bad_function_call exception when
compiled with VisualStudio 7.1. It happens with both boost-1.30.2
and boost_1_31_0_rc2. No problems when compiled with g++ 2.95.1
on solaris.

----
#include <boost/bind.hpp>
#include <boost/function.hpp>
using namespace boost;
#include <iostream>
using namespace std;
double f(int i, double d) {
    cout << "int = " << i << endl;
    return d;
}
main() {
    boost::function<double (int)> bound_func = boost::bind(f, _1, 1.234);
    int i = 99;
    cout << bound_func(i) << endl;
}
----
Peter Dimov wrote:
>Could you please post a message to the developer's list
>(or if that's a problem, post it here) with an appropriately alarming
>subject :-) containing a complete program that demonstrates the problem? 
>(So
>that we try to fix it before 1.31 goes out.)
_________________________________________________________________
Get a FREE online virus check for your PC here, from McAfee. 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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