[spirit-qi] [attr] Invalid static_cast error
3 Mar
2017
3 Mar
'17
8:40 a.m.
Hi, I try to generate a string using qi::attr, and the following is the code. #include <boost/spirit/include/qi.hpp> namespace qi = boost::spirit::qi; int main(){ // ok qi::rule<char const *, std::string()> world = qi::attr("world"); qi::rule<char const *, std::string()> rule = qi::eps > world; // error: invalid static_cast from type 'const char [6]' to type 'char' // qi::rule<char const *, std::string()> rule = qi::eps > qi::attr("world"); } Do I miss something or it is a bug? How can I fix it without using extra rules or semantic actions. Platform: win7 64bit Compiler: gcc 4.9.1 Boost 1.63 Since I typed on my phone, forgive me if there are errors. Best regards, Yuan Yao
2758
Age (days ago)
2758
Last active (days ago)
0 comments
1 participants
participants (1)
-
含露月含露月