Problem with qi::_1 and qi::_3

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with qi::_1 and qi::_3

Jens Kallup
Hello

I have following snippet, that cause me error at compile time.
The problem may lay in "op2(qi::_1,qi::_2)",
because in this form, the compiler fails.
When I use "op2(qi::_1,0.00)", all Ok.

What can I do?
the rule is:

qi::rule<Iterator, Skipper> symbol_def_expr, variable;
qi::rule<Iterator, double, Skipper> symbol_expr;

     struct compile_op2
     {
         typedef double result_type;
         compile_op2() { }
         template<typename T1, typename T2>
         double operator()(T1 const &t1, T2 const &t2) const
         {
             QString s1 = typeid(T1).name();
             QString s2 = typeid(T2).name();

             MsgBox("typsers",QString("--->%1<-->%2")
             .arg(s1)
             .arg(s2));
         }
         return 0.1;
     };

     phoenix::function<compile_op2> op2;

 1.
    symbol_def_expr =
 2.
    (
 3.
    (
 4.
         variable
 5.
    >>   lit("=")
 6.
    >>   symbol_expr [
 7.
             op2(qi::_1,qi::_3) ]
 8.
    )
 9.
    )
10.
    ;

Thanks for helping

Jens


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Loading...