diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 4ca4b237..f22dc464 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +64,16 @@ namespace boost { namespace fusion template struct pure : remove_cv::type> {}; + template ::value> + struct is_convertible_to_first + : boost::is_convertible::type> + {}; + + template + struct is_convertible_to_first + : mpl::false_ + {}; + template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline each_elem @@ -77,12 +88,13 @@ namespace boost { namespace fusion BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline from_sequence< typename lazy_enable_if_c< - (traits::is_sequence::value && - !is_same::value) + (traits::is_sequence::type>::value && + !is_same::type>::value && + !is_convertible_to_first::value) , make_indices_from_seq >::type > - dispatch(Sequence const&) BOOST_NOEXCEPT + dispatch(Sequence&&) BOOST_NOEXCEPT { return from_sequence::type>(); } @@ -306,7 +318,7 @@ namespace boost { namespace fusion // In the (near) future release, should be fixed. /* BOOST_CONSTEXPR */ BOOST_FUSION_GPU_ENABLED vector(U&&... u) - : base(vector_detail::dispatch(u...), std::forward(u)...) + : base(vector_detail::dispatch(std::forward(u)...), std::forward(u)...) {} template