id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7503,for_each does not compile with g++-4.7.1,veso ,Joel de Guzman,"Hello, The following code works fine with g++-4.4 and can not compile with g++-4.7.1. #include #include #include #include #include #include #include namespace fusion = boost::fusion; template struct is_same_key: public std::is_same {}; struct print_ftor { template inline void operator()(const boost::fusion::pair& pair) const { std::cout << ""type: "" << typeid(Key_T).name() << "", value: "" << pair.second << std::endl; } }; int main () { typedef fusion::map< fusion::pair, fusion::pair > map_type; map_type map_sequence( fusion::make_pair('X'), fusion::make_pair(""Men"") ); fusion::for_each( fusion::filter_if< is_same_key< double, boost::mpl::_1> >(map_sequence), print_ftor()); return 0; } The error which the compiler produces is: g++-4.7 -o test -std=c++0x -Wall -pedantic -I/home/veso/boost_1_52_0_beta1 main.c++ main.c++: In instantiation of ‘struct is_same_key >’: /home/veso/boost_1_52_0_beta1/boost/fusion/algorithm/iteration/detail/for_each.hpp:32:9: required from ‘void boost::fusion::detail::for_each_linear(const First&, const Last&, const F&, mpl_::false_) [with First = boost::fusion::filter_iterator, boost::fusion::basic_iterator, boost::fusion::pair > >::category, const boost::fusion::map, boost::fusion::pair > >, 0>, boost::fusion::basic_iterator, boost::fusion::pair > >::category, const boost::fusion::map, boost::fusion::pair > >, 2>, is_same_key > >; Last = boost::fusion::filter_iterator, boost::fusion::basic_iterator, boost::fusion::pair > >::category, const boost::fusion::map, boost::fusion::pair > >, 2>, boost::fusion::basic_iterator, boost::fusion::pair > >::category, const boost::fusion::map, boost::fusion::pair > >, 2>, is_same_key > >; F = print_ftor; mpl_::false_ = mpl_::bool_]’ /home/veso/boost_1_52_0_beta1/boost/fusion/algorithm/iteration/detail/for_each.hpp:42:9: required from ‘void boost::fusion::detail::for_each_dispatch(Sequence&, const F&, Tag) [with Sequence = const boost::fusion::filter_view, boost::fusion::pair > >, is_same_key > >; F = print_ftor; Tag = boost::mpl::inherit2]’ /home/veso/boost_1_52_0_beta1/boost/fusion/algorithm/iteration/detail/for_each.hpp:132:9: required from ‘void boost::fusion::detail::for_each(Sequence&, const F&, mpl_::false_) [with Sequence = const boost::fusion::filter_view, boost::fusion::pair > >, is_same_key > >; F = print_ftor; mpl_::false_ = mpl_::bool_]’ /home/veso/boost_1_52_0_beta1/boost/fusion/algorithm/iteration/for_each.hpp:49:9: required from ‘typename boost::enable_if, void>::type boost::fusion::for_each(const Sequence&, const F&) [with Sequence = boost::fusion::filter_view, boost::fusion::pair > >, is_same_key > >; F = print_ftor; typename boost::enable_if, void>::type = void]’ main.c++:33:19: required from here main.c++:13:8: error: no type named ‘first_type’ in ‘struct mpl_::arg<1>’ make: *** [all] Error 1 For the test I used Debian stable with g++-4.7 installed from the backport repository. The bug appears with boost versions 1.42, 1.51, 1.51beta1 ",Bugs,closed,Boost 1.52.0,fusion,Boost 1.51.0,Problem,fixed,,