Opened 11 years ago
Closed 11 years ago
#6102 closed Bugs (fixed)
call to fusion::zip() does not compile with BOOST_RESULT_OF_USE_DECLTYPE
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | To Be Determined | Component: | fusion |
Version: | Boost 1.47.0 | Severity: | Problem |
Keywords: | C++11; C++0x; decltype | Cc: |
Description
The following trivial use of fusion::zip() fails to compile with -DBOOST_RESULT_OF_USE_DECLTYPE
#include <boost/fusion/algorithm/transformation/zip.hpp> #include <boost/fusion/container/vector.hpp> using namespace boost::fusion; int main() { vector<int,char> v1(1, 'a'); vector<int,char> v2(2, 'b'); zip(v1, v2); }
Errors:
In file included from boost/boost/preprocessor/iteration/detail/iter/forward1.hpp:57:0, from boost/boost/utility/result_of.hpp:95, from boost/boost/fusion/support/detail/segmented_fold_until_impl.hpp :13, from boost/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl .hpp:15, from boost/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp :10, from boost/boost/fusion/sequence/intrinsic/begin.hpp:17, from boost/boost/fusion/iterator/segmented_iterator.hpp:12, from boost/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp :11, from boost/boost/fusion/sequence/intrinsic/end.hpp:17, from boost/boost/fusion/mpl/back.hpp:11, from boost/boost/fusion/mpl.hpp:15, from boost/boost/fusion/view/detail/strictest_traversal.hpp:14, from boost/boost/fusion/view/zip_view/zip_view.hpp:14, from boost/boost/fusion/view/zip_view.hpp:11, from boost/boost/fusion/algorithm/transformation/zip.hpp:12, from test.cpp:1: boost/boost/utility/detail/result_of_iterate.hpp: In instantiation of 'boost::detail::cpp0x_result_of_impl< boost::fusion::detail::strictest_traversal_impl( const boost::fusion::random_access_traversal_tag & , const boost::fusion::vector<int, char> & ) >': boost/boost/utility/detail/result_of_iterate.hpp:41:8: required from 'boost::result_of< boost::fusion::detail::strictest_traversal_impl( const boost::fusion::random_access_traversal_tag & , const boost::fusion::vector<int, char> & ) >' boost/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp:267:13: required from 'boost::fusion::detail::result_of_first_unrolledfold< const boost::fusion::random_access_traversal_tag & , boost::fusion::filter_iterator< boost::fusion::forward_traversal_tag , boost::fusion::vector_iterator< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, 0 >, boost::fusion::vector_iterator< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, 2 >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > >, boost::fusion::detail::strictest_traversal_impl, 2 >' boost/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp:279:13: required from 'boost::fusion::detail::fold_impl< 2, const boost::fusion::random_access_traversal_tag & , boost::fusion::filter_view< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > >, boost::fusion::detail::strictest_traversal_impl >' boost/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp:306:16: required from 'boost::fusion::detail::result_of_fold< boost::fusion::filter_view< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > >, boost::fusion::random_access_traversal_tag , boost::fusion::detail::strictest_traversal_impl, false >' boost/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp:320:16: required from 'boost::fusion::result_of::fold< boost::fusion::filter_view< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > >, boost::fusion::random_access_traversal_tag , boost::fusion::detail::strictest_traversal_impl >' boost/boost/fusion/view/detail/strictest_traversal.hpp:59:16: required from 'boost::fusion::detail::strictest_traversal< boost::fusion::filter_view< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > > >' boost/boost/fusion/view/zip_view/zip_view.hpp:99:76: required from 'boost::fusion::zip_view< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & > >' test.cpp:10:15: required from here boost/boost/utility/detail/result_of_iterate.hpp:64:5: error: no match for call to '(boost::fusion::detail::strictest_traversal_impl) ( const boost::fusion::random_access_traversal_tag & , const boost::fusion::vector<int, char> & )' In file included from boost/boost/preprocessor/iteration/detail/iter/forward1.hpp:52:0, from boost/boost/utility/result_of.hpp:95, from boost/boost/fusion/support/detail/segmented_fold_until_impl.hpp :13, from boost/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl .hpp:15, from boost/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp :10, from boost/boost/fusion/sequence/intrinsic/begin.hpp:17, from boost/boost/fusion/iterator/segmented_iterator.hpp:12, from boost/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp :11, from boost/boost/fusion/sequence/intrinsic/end.hpp:17, from boost/boost/fusion/mpl/back.hpp:11, from boost/boost/fusion/mpl.hpp:15, from boost/boost/fusion/view/detail/strictest_traversal.hpp:14, from boost/boost/fusion/view/zip_view/zip_view.hpp:14, from boost/boost/fusion/view/zip_view.hpp:11, from boost/boost/fusion/algorithm/transformation/zip.hpp:12, from test.cpp:1: boost/boost/utility/detail/result_of_iterate.hpp: In instantiation of 'boost::detail::cpp0x_result_of_impl< boost::fusion::detail::seq_ref_size( const boost::fusion::vector<int, char> & ) >': boost/boost/utility/detail/result_of_iterate.hpp:41:8: required from 'boost::result_of< boost::fusion::detail::seq_ref_size( const boost::fusion::vector<int, char> & ) >' boost/boost/fusion/view/transform_view/detail/apply_transform_result.hpp:28:20: required from 'boost::fusion::detail::apply_transform_result< boost::fusion::detail::seq_ref_size >::apply<const boost::fusion::vector<int, char> &>' boost/boost/mpl/aux_/preprocessed/gcc/apply_wrap.hpp:36:8: required from 'boost::mpl::apply_wrap1< boost::fusion::detail::apply_transform_result< boost::fusion::detail::seq_ref_size >, const boost::fusion::vector<int, char> & >' boost/boost/mpl/aux_/preprocessed/gcc/apply.hpp:42:8: required from 'boost::mpl::apply1< boost::fusion::detail::apply_transform_result< boost::fusion::detail::seq_ref_size >, const boost::fusion::vector<int, char> & >' boost/boost/mpl/aux_/preprocessed/gcc/apply.hpp:59:8: required from 'boost::mpl::apply< boost::fusion::detail::apply_transform_result< boost::fusion::detail::seq_ref_size >, const boost::fusion::vector<int, char> & >' boost/boost/fusion/view/transform_view/detail/deref_impl.hpp:37:79: required from 'boost::fusion::extension::deref_impl< boost::fusion::transform_view_iterator_tag >::apply< boost::fusion::transform_view_iterator< boost::fusion::filter_iterator< boost::fusion::forward_traversal_tag , boost::fusion::vector_iterator< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, 0 >, boost::fusion::vector_iterator< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, 2 >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > >, boost::fusion::detail::seq_ref_size > >' boost/boost/fusion/iterator/deref.hpp:50:16: required from 'boost ::fusion::result_of::deref< boost::fusion::transform_view_iterator< boost::fusion::filter_iterator< boost::fusion::forward_traversal_tag , boost::fusion::vector_iterator< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, 0 >, boost::fusion::vector_iterator< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, 2 >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > >, boost::fusion::detail::seq_ref_size > >' boost/boost/fusion/sequence/intrinsic/front.hpp:22:16: required from 'boost::fusion::result_of::front< boost::fusion::transform_view< boost::fusion::filter_view< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > >, boost::fusion::detail::seq_ref_size, boost::fusion::void_ > >' boost/boost/fusion/view/zip_view/zip_view.hpp:87:117: required from 'boost::fusion::detail::min_size< boost::fusion::filter_view< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & >, boost::mpl::not_< boost::is_same< mpl_::arg<-0x00000000000000001> , const boost::fusion::unused_type & > > > >' boost/boost/fusion/view/zip_view/zip_view.hpp:104:65: required from 'boost::fusion::zip_view< boost::fusion::vector2< const boost::fusion::vector<int, char> & , const boost::fusion::vector<int, char> & > >' test.cpp:10:15: required from here boost/boost/utility/detail/result_of_iterate.hpp:64:5: error: no match for call to '(boost::fusion::detail::seq_ref_size) ( const boost::fusion::vector<int, char> & )'
Note:
See TracTickets
for help on using tickets.
Michel Morin's patch from this post fixes the problem:
http://thread.gmane.org/gmane.comp.parsers.spirit.general/23386/focus=23389