Ticket #4043: test.cpp
| File test.cpp, 327 bytes (added by , 13 years ago) |
|---|
| Line | |
|---|---|
| 1 | # include <iostream> |
| 2 | # include "boost/lambda/lambda.hpp" |
| 3 | # include "boost/lambda/bind.hpp" |
| 4 | # include "boost/function.hpp" |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | int obj = 100; |
| 9 | int incr = 3; |
| 10 | boost::function<void (int &)> fun = boost::lambda::_1 += incr; |
| 11 | incr = 0; |
| 12 | fun(obj); |
| 13 | std::cout << obj << "\n"; /* should print 103, but prints 100 */ |
| 14 | } |
