Boost logo

Boost :

From: Vyacheslav E. Andrejev (vandrejev_at_[hidden])
Date: 2004-11-03 04:19:14


Hi All,

boost::spirit::select_p parser can not be compiled with boost::spirit::rule
as argument.

The problem is that metafunction
boost::spirit::impl::as_embedded_parser<ParserT> returns const reference to
boost::spirit::rule, not boost::spirit::rule itself, when PaerserT =
boost::spirit::rule. So trying to compile
parser_result<as_embedded_parser<rule<> > > deep inside the select_p
implementation generates error message that const rule<>& has no
result_type.

I suggest to change parser_result definition as following:

    template <typename ParserT, typename ScannerT>
    struct parser_result
    {
      typedef typename boost::remove_reference<ParserT>::type::template
result<ScannerT>::type type;
    };

-- 
______________________________
Vyacheslav E. Andrejev
System Architect, Excelsior, LLC

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk