By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 765 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

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

P: n/a

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 =----- - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Ingo Nolden wrote in news:op************** 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.