Boost logo

Boost Users :

From: Arturo_Cuebas_at_[hidden]
Date: 2005-02-21 15:45:53


In my previous post the sample code was a lot more than
what what necessary to ask the question. I could have
given this simpler example:

#include <boost/function.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>

using namespace boost;
using namespace boost::lambda;

int f(void)
{
   return 5;
}

int main(void)
{
   int test = 0;

   (_1 = bind(&f))(test); // No compile error
 
   function<int (void)> functorized_f(&f);

   (_1 = functorized_f)(test); // Compile error

   return 0;
}

This is what my question really boils down to: just like
naming delayed variables, is it possible to predefine and
name the result of a call to bind() outside a lambda
expression?

/*what goes here?*/ bound_f = bind(&f);
(_1 = bound_f)(test);


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