Boost logo

Boost Users :

From: Cheenu Srinivasan (cheenu_srinivasan_at_[hidden])
Date: 2004-02-01 08:45:43

I wish to store the return value of boost::bind in an intermediate object
to invoke it at a later time. I only ever see examples which combine
the call to boost:bind with the immediate invocation on the returned
object such as:

    #include <boost/bind.hpp>
    using namespace boost;
    #include <iostream>
    using namespace std;

    double f(int i, double d) {
      cout << "int = " << i << endl;
      return d;

    main() {
      int i = 99;
      cout << bind(f, _1, 1.234)(i) << endl;

Instead I'd like to postpone the call to the returned object. What's the
type of obj?

  main() {
    int i = 99;
    WHAT_IS_MY_TYPE obj = bind(f, _1, 1.234);
    cout << obj(i) << endl;


What are the 5 hot job markets for 2004? Click here to find out.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at