Ticket #3583: fusion.diff
File fusion.diff, 2.2 KB (added by , 13 years ago) |
---|
-
boost/fusion/view/single_view/detail/deref_impl.hpp
10 10 #include <boost/fusion/support/detail/access.hpp> 11 11 #include <boost/mpl/identity.hpp> 12 12 #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> 13 16 14 17 namespace boost { namespace fusion 15 18 { … … 26 29 template <typename Iterator> 27 30 struct apply 28 31 { 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; 30 41 31 42 static type 32 43 call(Iterator const& i) 33 44 { 34 return i.v al;45 return i.view.val; 35 46 } 36 47 }; 37 48 }; -
boost/fusion/view/single_view/single_view_iterator.hpp
32 32 { 33 33 typedef single_view_iterator_tag fusion_tag; 34 34 typedef forward_traversal_tag category; 35 typedef typename SingleView::value_type value_type;36 35 typedef SingleView single_view_type; 37 36 38 explicit single_view_iterator(single_view_type const& view)39 : v al(view.val) {}37 explicit single_view_iterator(single_view_type& view) 38 : view(view) {} 40 39 41 value_type val;40 SingleView& view; 42 41 }; 43 42 }} 44 43