diff options
Diffstat (limited to 'boost/fusion/container/vector/detail/vector_n.hpp')
-rw-r--r-- | boost/fusion/container/vector/detail/vector_n.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/boost/fusion/container/vector/detail/vector_n.hpp b/boost/fusion/container/vector/detail/vector_n.hpp index 431774b37c..4e249c7fe7 100644 --- a/boost/fusion/container/vector/detail/vector_n.hpp +++ b/boost/fusion/container/vector/detail/vector_n.hpp @@ -68,6 +68,16 @@ return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i)); } + template <typename Sequence> + static BOOST_PP_CAT(vector_data, N) + init_from_sequence(Sequence& seq) + { + typedef typename result_of::begin<Sequence>::type I0; + I0 i0 = fusion::begin(seq); + BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_ITER_DECL_VAR, _) + return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i)); + } + BOOST_PP_REPEAT(N, FUSION_MEMBER_DECL, _) }; @@ -109,6 +119,15 @@ ) : base_type(base_type::init_from_sequence(seq)) {} + template <typename Sequence> + BOOST_PP_CAT(vector, N)( + Sequence& seq +#if (N == 1) + , typename boost::disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0 +#endif + ) + : base_type(base_type::init_from_sequence(seq)) {} + template <BOOST_PP_ENUM_PARAMS(N, typename U)> BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, U)> const& vec) |