$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2007-03-14 17:15:59
"Peng Yu" <pengyu.ut_at_[hidden]> wrote
> I'm made up the following example. But it's not working. Could you
> please show me how to make it work?
> #include <boost/lambda/lambda.hpp>
> #include <boost/lambda/core.hpp>
> #include <iostream>
>
> using namespace boost::lambda;
>
> int main() {
> std::cout << (_1 + _2)(10, 10) << std::endl;
> }
The function object -- the result of _1 + _2 -- requires T&, and therefore
you can't pass constants to it. The following will work:
int n1 = 10;
int n2 = 10;
cout << (_1 + _2)(n1, n2) << endl;
HTH,
Arkadiy