Ticket #3583: fusion.diff

File fusion.diff, 2.2 KB (added by Christopher Schmidt, 13 years ago)
  • boost/fusion/view/single_view/detail/deref_impl.hpp

     
    1010#include <boost/fusion/support/detail/access.hpp>
    1111#include <boost/mpl/identity.hpp>
    1212#include <boost/type_traits/is_const.hpp>
     13#include <boost/mpl/if.hpp>
     14#include <boost/type_traits/add_const.hpp>
     15#include <boost/type_traits/add_reference.hpp>
    1316
    1417namespace boost { namespace fusion
    1518{
     
    2629            template <typename Iterator>
    2730            struct apply
    2831            {
    29                 typedef typename Iterator::value_type type;
     32                typedef typename
     33                    add_reference<
     34                        typename mpl::if_<
     35                            is_const<typename Iterator::single_view_type>
     36                          , typename add_const<typename Iterator::single_view_type::value_type>::type
     37                          , typename Iterator::single_view_type::value_type
     38                        >::type
     39                    >::type
     40                type;
    3041   
    3142                static type
    3243                call(Iterator const& i)
    3344                {
    34                     return i.val;
     45                    return i.view.val;
    3546                }
    3647            };
    3748        };
  • boost/fusion/view/single_view/single_view_iterator.hpp

     
    3232    {
    3333        typedef single_view_iterator_tag fusion_tag;
    3434        typedef forward_traversal_tag category;
    35         typedef typename SingleView::value_type value_type;
    3635        typedef SingleView single_view_type;
    3736
    38         explicit single_view_iterator(single_view_type const& view)
    39             : val(view.val) {}
     37        explicit single_view_iterator(single_view_type& view)
     38            : view(view) {}
    4039
    41         value_type val;
     40        SingleView& view;
    4241    };
    4342}}
    4443