1

Here is a code sample:

// file main.cpp

#include <iostream>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_io.hpp>
#include <boost/spirit/include/qi.hpp>

int main()
{
    std::string s( "1 A" );
    boost::tuple<double, char> p;
    complex_matrix_parser::iterator b = s.begin();
    complex_matrix_parser::iterator e = s.end();
    qi::phrase_parse( b, e,
            ( qi::double_ >> qi::char_('A') ),
            qi::space, qi::skip_flag::postskip, p );

    std::cerr << "==== " << p << std::endl;

    return 0;
}

This should print ==== (1 A) right? But it prints ==== (1 ), so it skips the 'A' character.

What am I doing wrong here?

Vahagn
  • 4,670
  • 9
  • 43
  • 72

1 Answers1

2

Use boost::fusion::vector instead of the boost::tuple and everything will work.

eddi
  • 49,088
  • 6
  • 104
  • 155
  • Because `boost::tuple` is not a `boost::fusion` sequence, although it could be adapted into one if you included `boost/fusion/adapted/boost_tuple.hpp`. – eddi Oct 09 '12 at 14:42