| 1 | #include <boost/spirit/include/qi.hpp>
|
|---|
| 2 | #include <boost/spirit/include/phoenix.hpp>
|
|---|
| 3 | #include <boost/phoenix/stl.hpp>
|
|---|
| 4 | #include <boost/spirit/include/qi_uint.hpp>
|
|---|
| 5 | #include <boost/phoenix/phoenix.hpp>
|
|---|
| 6 |
|
|---|
| 7 | std::vector<unsigned> L;
|
|---|
| 8 |
|
|---|
| 9 | int
|
|---|
| 10 | main() {
|
|---|
| 11 | using namespace boost::spirit::qi;
|
|---|
| 12 | using namespace boost::phoenix;
|
|---|
| 13 | using boost::phoenix::arg_names::_1;
|
|---|
| 14 | const std::string str("3 1 2 3");
|
|---|
| 15 | std::string::const_iterator first = str.begin();
|
|---|
| 16 | parse(first,str.end(), uint_[reserve(L,_1)] >> repeat(capacity(L))[ uint_ ]);
|
|---|
| 17 |
|
|---|
| 18 | }
|
|---|