I
Ingo Nolden
Hi,
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
initializers
and
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
variables.
thank you for your help.
Ingo
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
initializers
and
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
variables.
thank you for your help.
Ingo