Ticket #6948: 2.cpp
| File 2.cpp, 445 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 | //auto par = '{' << -(boost::spirit::karma::int_ % ',') << '}';//This would lead error! |
| 7 | int main(){ |
| 8 | using namespace std; |
| 9 | namespace karma = boost::spirit::karma; |
| 10 | list<int> l{1, 2, 4}; |
| 11 | auto par = '{' << -(boost::spirit::karma::int_ % ',') << '}';//This would not! |
| 12 | cout<<karma::format(par, l)<<endl; |
| 13 | return 0; |
| 14 | } |
