Index: boost/fusion/view/single_view/detail/deref_impl.hpp =================================================================== --- boost/fusion/view/single_view/detail/deref_impl.hpp (revision 57281) +++ boost/fusion/view/single_view/detail/deref_impl.hpp (working copy) @@ -10,6 +10,9 @@ #include #include #include +#include +#include +#include namespace boost { namespace fusion { @@ -26,12 +29,20 @@ template struct apply { - typedef typename Iterator::value_type type; + typedef typename + add_reference< + typename mpl::if_< + is_const + , typename add_const::type + , typename Iterator::single_view_type::value_type + >::type + >::type + type; static type call(Iterator const& i) { - return i.val; + return i.view.val; } }; }; Index: boost/fusion/view/single_view/single_view_iterator.hpp =================================================================== --- boost/fusion/view/single_view/single_view_iterator.hpp (revision 57281) +++ boost/fusion/view/single_view/single_view_iterator.hpp (working copy) @@ -32,13 +32,12 @@ { typedef single_view_iterator_tag fusion_tag; typedef forward_traversal_tag category; - typedef typename SingleView::value_type value_type; typedef SingleView single_view_type; - explicit single_view_iterator(single_view_type const& view) - : val(view.val) {} + explicit single_view_iterator(single_view_type& view) + : view(view) {} - value_type val; + SingleView& view; }; }}