|
Boost : |
Subject: Re: [boost] [fusion] for_each on gcc 4.7
From: Daniel Larimer (dlarimer_at_[hidden])
Date: 2012-06-20 22:00:56
On Jun 20, 2012, at 9:57 PM, Daniel Larimer wrote:
> On Jun 20, 2012, at 7:36 PM, Joel de Guzman wrote:
>
>> On 6/20/2012 1:37 PM, Daniel Larimer wrote:
>>> I recently attempted to update to gcc 4.7 and code that compiled with 4.5.3 broke.
>>>
>>> It appears that boost::fusion expects boost::fusion::random_access_traversal_tag to implicitly cast to mpl::bool_<false>.
>>>
>>> Switching the 3rd argument from mpl::bool_<false> to an extra template arg (that was ignored), seems to fix the compilation errors.
>>>
>>> Compiled with std=c++11
>>
>> Do you have a minimal test case?
>
> #include <boost/fusion/container/vector.hpp>
> #include <boost/fusion/algorithm.hpp>
> #include <boost/fusion/include/make_vector.hpp>
>
> struct visitor {
> template<typename T>
> void operator()( T t )const{}
> };
>
> int main() {
> visitor v;
> boost::fusion::for_each( boost::fusion::make_vector(5,6.6), v );
> return 0;
> }
>
I could get things to compile by editing boost/fusion/algorithm/iteration/detail/for_each.hpp and changing the last parameter to Ty. It appears that parameter was ignored anyway and that we didn't care about the type.
template <typename Sequence, typename F, typename Ty>
inline void
for_each(Sequence& seq, F const& f, Ty) // unsegmented implementation
{
detail::for_each_dispatch(seq, f, typename traits::category_of<Sequence>::type());
}
>>
>> Regards,
>> --
>> Joel de Guzman
>> http://www.boostpro.com
>> http://boost-spirit.com
>>
>>
>>
>>
>> _______________________________________________
>> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk