|
Boost Users : |
Subject: Re: [Boost-users] [Phoenix] : Using phoenix with zip_iterator
From: Manjunath Kudlur (keveman_at_[hidden])
Date: 2010-03-16 01:07:27
> Your code works for me. What version of boost and what compiler
> are you using?
I grabbed the most recent boost-trunk from SVN. Here is the output of my g++ -v.
$ g++ -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.4.1-4ubuntu9'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --enable-multiarch --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4
--program-suffix=-4.4 --enable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-objc-gc --enable-targets=all
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)
Here is the compiler error :
zip.cpp: In member function int get0_::operator()(Arg) const:
zip.cpp:33: error: expected primary-expression before ) token
In file included from /usr/include/c++/4.4/algorithm:62,
from zip.cpp:3:
/usr/include/c++/4.4/bits/stl_algo.h: In function _Funct
std::for_each(_IIter, _IIter, _Funct) [with _IIter =
boost::zip_iterator<boost::tuples::tuple<__gnu_cxx::__normal_iterator<int*,
std::vector<int, std::allocator<int> > >,
__gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > >, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> >, _Funct =
boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::shift_left_eval,
boost::fusion::vector<boost::phoenix::reference<std::basic_ostream<char,
std::char_traits<char> > >,
boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<get0_>,
boost::phoenix::argument<0>, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >
>]:
zip.cpp:51: instantiated from here
/usr/include/c++/4.4/bits/stl_algo.h:4200: error: no match for call to
(boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::shift_left_eval,
boost::fusion::vector<boost::phoenix::reference<std::basic_ostream<char,
std::char_traits<char> > >,
boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<get0_>,
boost::phoenix::argument<0>, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > >)
(boost::tuples::cons<int&, boost::tuples::cons<int&,
boost::tuples::null_type> >)
/home/kvm/boost/boost-trunk/boost/spirit/home/phoenix/core/actor.hpp:90:
note: candidates are: typename boost::mpl::eval_if<typename
Eval::no_nullary,
boost::mpl::identity<boost::phoenix::detail::error_expecting_arguments>,
boost::phoenix::eval_result<Eval,
boost::phoenix::basic_environment<boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >
>::type boost::phoenix::actor<Eval>::operator()() const [with Eval =
boost::phoenix::composite<boost::phoenix::shift_left_eval,
boost::fusion::vector<boost::phoenix::reference<std::basic_ostream<char,
std::char_traits<char> > >,
boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<get0_>,
boost::phoenix::argument<0>, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >]
/home/kvm/boost/boost-trunk/boost/spirit/home/phoenix/core/actor.hpp:107:
note: typename
boost::phoenix::actor<Eval>::result<boost::phoenix::actor<Eval>(T0&)>::type
boost::phoenix::actor<Eval>::operator()(T0&) const [with T0 =
boost::tuples::cons<int&, boost::tuples::cons<int&,
boost::tuples::null_type> >, Eval =
boost::phoenix::composite<boost::phoenix::shift_left_eval,
boost::fusion::vector<boost::phoenix::reference<std::basic_ostream<char,
std::char_traits<char> > >,
boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<get0_>,
boost::phoenix::argument<0>, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >]
When I replace a1.get<0>() with boost::tuples::get<0>(a1) I get the
following error :
In file included from /usr/include/c++/4.4/algorithm:62,
from zip.cpp:3:
/usr/include/c++/4.4/bits/stl_algo.h: In function _Funct
std::for_each(_IIter, _IIter, _Funct) [with _IIter =
boost::zip_iterator<boost::tuples::tuple<__gnu_cxx::__normal_iterator<int*,
std::vector<int, std::allocator<int> > >,
__gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > >, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> >, _Funct =
boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::shift_left_eval,
boost::fusion::vector<boost::phoenix::reference<std::basic_ostream<char,
std::char_traits<char> > >,
boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<get0_>,
boost::phoenix::argument<0>, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >
>]:
zip.cpp:51: instantiated from here
/usr/include/c++/4.4/bits/stl_algo.h:4200: error: no match for call to
(boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::shift_left_eval,
boost::fusion::vector<boost::phoenix::reference<std::basic_ostream<char,
std::char_traits<char> > >,
boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<get0_>,
boost::phoenix::argument<0>, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> > >)
(boost::tuples::cons<int&, boost::tuples::cons<int&,
boost::tuples::null_type> >)
/home/kvm/boost/boost-trunk/boost/spirit/home/phoenix/core/actor.hpp:90:
note: candidates are: typename boost::mpl::eval_if<typename
Eval::no_nullary,
boost::mpl::identity<boost::phoenix::detail::error_expecting_arguments>,
boost::phoenix::eval_result<Eval,
boost::phoenix::basic_environment<boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >
>::type boost::phoenix::actor<Eval>::operator()() const [with Eval =
boost::phoenix::composite<boost::phoenix::shift_left_eval,
boost::fusion::vector<boost::phoenix::reference<std::basic_ostream<char,
std::char_traits<char> > >,
boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<get0_>,
boost::phoenix::argument<0>, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >]
/home/kvm/boost/boost-trunk/boost/spirit/home/phoenix/core/actor.hpp:107:
note: typename
boost::phoenix::actor<Eval>::result<boost::phoenix::actor<Eval>(T0&)>::type
boost::phoenix::actor<Eval>::operator()(T0&) const [with T0 =
boost::tuples::cons<int&, boost::tuples::cons<int&,
boost::tuples::null_type> >, Eval =
boost::phoenix::composite<boost::phoenix::shift_left_eval,
boost::fusion::vector<boost::phoenix::reference<std::basic_ostream<char,
std::char_traits<char> > >,
boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<get0_>,
boost::phoenix::argument<0>, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >]
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net