1

以下のコードをコンパイルしようとしていますが、いつものように、spirit/phoenix のエラーは、何が間違っているかについての手がかりをあまり与えません。誰が問題が何であるかを見ることができますか?

#include <boost/spirit/include/phoenix.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/shared_ptr.hpp>


typedef boost::shared_ptr<int> sptr;


struct bar
{
    template <typename A> struct result
    {
        typedef sptr type;
    };

    template <typename A> sptr operator()(A) const
    {
        return sptr();
    }
};


boost::phoenix::function<bar> foo;


void test()
{
    namespace qi = boost::spirit::qi;
    using qi::_val;

    qi::rule
    <
        std::string::const_iterator,
        sptr(),
        boost::spirit::ascii::space_type
    >
        test_rule = qi::eps [ _val = foo() ];
}
4

1 に答える 1