468,765 Members | 1,153 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

boost::spirit::actor doesn't accept a std::vector<int>


I am using spirit 1.31
I have been trying the following example from the spirit docs. I tried it
with int and double neither works:

vector<int> v;
rule<> r = list_p(int_p[push_back_a(v)], ch_p(','));

but it gives the weird messages:

boost\spirit\actor\push_back_actor.hpp(61) : error C2078: too many


boost\spirit\actor\push_back_actor.hpp(61) : error C2440: 'initializing'
: cannot convert from 'const iterator_t ' to 'value_type'

When I put v into another vector:

vector< vector< int > > v;

it will compile fine, but it will put the first char into one int, and the
nested vectors will contain only this one int.

I am including these spirit headers:

#include <boost/spirit/core.hpp>
#include <boost/spirit/utility/confix.hpp>
#include <boost/spirit/utility/lists.hpp>
#include <boost/spirit/utility/escape_char.hpp>
#include <boost/spirit/actor/push_back_actor.hpp>

Am I missing a header file? I tried also assign_a with an int. That worked
fine. So I expected the above would parse numbers into int or double

thank you for your help.
~ Samba, more than a low cost File and Printer server ~

-- Let us OpenSource --
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 22 '05 #1
1 1853
Ingo Nolden wrote in news:op**************@news.univ-angers.fr in
I am using spirit 1.31

I'd strongly suggest a Spirit mailing list:


it has a news gateway here:



Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rookie | last post: by
3 posts views Thread by jx2 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.