Ticket #6948: 2_new.cpp
| File 2_new.cpp, 477 bytes (added by , 10 years ago) |
|---|
| Line | |
|---|---|
| 1 | #include<boost/spirit/include/karma.hpp> |
| 2 | #include<boost/spirit/include/karma_format_attr.hpp> |
| 3 | #include<list> |
| 4 | #include<iostream> |
| 5 | |
| 6 | BOOST_AUTO(par, '{' << -(boost::spirit::karma::int_ % ',') << '}');//Define par here would lead to error! |
| 7 | int main(){ |
| 8 | using namespace std; |
| 9 | namespace karma = boost::spirit::karma; |
| 10 | list<int> l{1, 2, 4}; |
| 11 | //BOOST_AUTO(par, '{' << -(boost::spirit::karma::int_ % ',') << '}');//Whils this would not! |
| 12 | cout<<karma::format(par, l)<<endl; |
| 13 | return 0; |
| 14 | } |
