Это ошибка Phoenix v3.Компилируется с Phoenix v2 просто отлично.Я сделал отчет об ошибке.Я отмечу этот вопрос как решенный через 2 дня.Спасибо всем.
Я пытаюсь сделать короткую лямбу с помощью Phoenix, но получаю кучу ошибок компиляции.Вот код.
std::vector<unsigned char> data;
using boost::phoenix::arg_names::_1;
using boost::phoenix::static_cast_;
std::ostringstream oss;
oss << std::hex;
//Doesn't compile
std::for_each(data.begin(),data.end(), oss << static_cast_<unsigned int>(_1) );
//Compiles
std::for_each(data.begin(),data.end(), oss << _1 );
Теперь я получаю следующую ошибку компиляции из GCC 4.6.1: /usr/include/boost/utility/result_of.hpp:-1: In instantiation of ‘boost::detail::result_of_nested_result<boost::phoenix::static_cast_eval, boost::phoenix::static_cast_eval(boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::detail::target<unsigned char> >, 0l>&, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<1> >, 0l> >&, boost::phoenix::vector2<boost::phoenix::vector2<const boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<std::basic_ostringstream<char>&>, 0l> >, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::phoenix::tag::static_cast_, boost::proto::argsns_::list2<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::detail::target<unsigned char> >, 0l>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<1> >, 0l> > >, 2l> > >, 2l> >*, unsigned char&>&, const boost::phoenix::default_actions&>)>’:
/usr/include/boost/phoenix/object/static_cast.hpp:29: error: declaration of ‘struct boost::phoenix::static_cast_eval::result<boost::phoenix::static_cast_eval(boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::detail::target<unsigned char> >, 0l>&, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<1> >, 0l> >&, boost::phoenix::vector2<boost::phoenix::vector2<const boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<std::basic_ostringstream<char>&>, 0l> >, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::phoenix::tag::static_cast_, boost::proto::argsns_::list2<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::detail::target<unsigned char> >, 0l>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<1> >, 0l> > >, 2l> > >, 2l> >*, unsigned char&>&, const boost::phoenix::default_actions&>)>’
/usr/include/boost/phoenix/core/detail/preprocessed/call_10.hpp:65: error: no type named ‘type’ in ‘struct boost::result_of<boost::phoenix::static_cast_eval(boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::detail::target<unsigned char> >, 0l>&, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<1> >, 0l> >&, boost::phoenix::vector2<boost::phoenix::vector2<const boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<std::basic_ostringstream<char>&>, 0l> >, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::phoenix::tag::static_cast_, boost::proto::argsns_::list2<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::detail::target<unsigned char> >, 0l>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<1> >, 0l> > >, 2l> > >, 2l> >*, unsigned char&>&, const boost::phoenix::default_actions&>)>’