How to “concatenate” boost::mpl::vectors

前端 未结 3 910
误落风尘
误落风尘 2021-01-17 21:48

I have to different vectors

mpl::vector
mpl::vector

I\'d like to \"concatenate\" them to for

3条回答
  •  情书的邮戳
    2021-01-17 22:23

    You can use mpl::copy, which uses mpl::fold internally.

    typedef mpl::vector s0;
    typedef mpl::vector s1;
    typedef mpl::copy<
        s1,
        mpl::back_inserter
    >::type concatenated;
    
    BOOST_MPL_ASSERT((
        mpl::equal<
            concatenated,
            mpl::vector
        >
    ));
    

提交回复
热议问题