Boost logo

Boost Users :

Subject: Re: [Boost-users] large variant performance compared (50 elements)
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-01-18 07:36:02


On 01/17/11 18:35, Larry Evans wrote:
[snip]
> However, I'm still getting a compile error with gcc4.5.1. A partial
> list of the compilation output is also attached.
>
> Any ideas what's going wrong?
>
[snip]
Apparently gcc4.5.1 is more stringent about converting value types to
reference types.

Changing:

       template
       < typename VisitorType
       , typename IndexType
>
       inline typename VisitorType::result_type
     apply_visitor_impl
       ( VisitorType& rVisitor
       , boost::mpl::true_ /*is_unrolled_t*/
       ) const
     {
           typedef typename
         boost::mpl::at<Typelist, IndexType>::type
       type_t;
       return
         rVisitor
           ( boost::static_pointer_cast<typename type_t::value_type>
             ( m_spSelect
             )
           );
     }

to:

       template
       < typename VisitorType
       , typename IndexType
>
       inline typename VisitorType::result_type
     apply_visitor_impl
       ( VisitorType& rVisitor
       , boost::mpl::true_ /*is_unrolled_t*/
       ) const
     {
           typedef typename
         boost::mpl::at<Typelist, IndexType>::type::value_type
       value_t;
         boost::shared_ptr<value_t>
       spc(boost::static_pointer_cast<value_t>(m_spSelect));
       return rVisitor(spc);
     }

at around line 163 of CLoPtrVariant.hpp solved problem.


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