id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 6454,Problem when using phoenix::_if with boost::optional in Spirit,Öyvind Strand ,Thomas Heller,"A rule that yields a boost::optional as attribute won't compile when using qi::_1 as condition for phoenix::_if. However, if you add a phoenix statement after the if_ statement the rule compiles. //Doesn't compile qi::rule()> rule_a = (-qi::int_)[ phx::if_(qi::_1)[ phx::nothing ] //Uncomment next line and it compiles // , phx::nothing ] ; It doesn't help if you use another operator than - //Doesn't compile qi::rule >() > rule_b = (qi::int_ | qi::double_ | qi::eps)[ phx::if_(qi::_1)[ phx::nothing ] //Uncomment next line and it compiles // , phx::nothing ] ; The error doesn't manifest if you don't refer to qi::_1 //Compiles qi::rule >() > rule_c = (qi::int_ | qi::double_ | qi::eps)[ phx::if_(phx::val(true))[ phx::nothing ] ] ; It also works if you refer to qi::_1 but don't use phoenix::if_ //Compiles qi::rule()> rule_d = (-qi::int_)[ std::cout << qi::_1 ] ; Doing the same thing as in rule_a and rule_b outside of Spirit semantic actions also works //Compiles phx::if_(arg1)[ phx::nothing ] (boost::optional(5)); The problem doesn't seem to occur when using Phoenix v2 only v3",Bugs,new,To Be Determined,phoenix,Boost Development Trunk,Problem,,,