Ticket #9742: boostphxtest.cpp
| File boostphxtest.cpp, 495 bytes (added by , 9 years ago) |
|---|
| Line | |
|---|---|
| 1 | #include <iostream> |
| 2 | #include <vector> |
| 3 | |
| 4 | //WORKS: |
| 5 | //#include <boost/spirit/include/phoenix.hpp> |
| 6 | |
| 7 | //DOES NOT WORK: |
| 8 | #include <boost/phoenix.hpp> |
| 9 | |
| 10 | namespace phx = boost::phoenix; |
| 11 | |
| 12 | int main() |
| 13 | { |
| 14 | using phx::arg_names::arg1; |
| 15 | |
| 16 | std::vector<int> v; |
| 17 | for (int i = 1; i < 10; i++) |
| 18 | v.push_back(i); |
| 19 | |
| 20 | ( |
| 21 | std::cout << phx::val("("), |
| 22 | phx::for_each(arg1, phx::lambda[std::cout << arg1]), |
| 23 | std::cout << phx::val(")") |
| 24 | )(v); |
| 25 | |
| 26 | return 0; |
| 27 | } |
