mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 14:24:30 +02:00
Inserting elements at the beginning of Sequence, rather than at the end
This way we take advantage of the constant-time insertion and removal of elements at the beginning of Front Extensible sequences, such as list. This implementation is closer to the original.
This commit is contained in:
@@ -44,7 +44,7 @@ struct insert_range_impl
|
|||||||
>
|
>
|
||||||
struct apply
|
struct apply
|
||||||
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
||||||
: fold<
|
: reverse_fold<
|
||||||
joint_view<
|
joint_view<
|
||||||
iterator_range<typename begin<Sequence>::type,Pos>
|
iterator_range<typename begin<Sequence>::type,Pos>
|
||||||
, joint_view<
|
, joint_view<
|
||||||
@@ -53,12 +53,12 @@ struct insert_range_impl
|
|||||||
>
|
>
|
||||||
>
|
>
|
||||||
, typename clear<Sequence>::type
|
, typename clear<Sequence>::type
|
||||||
, insert<_1, end<_1>, _2>
|
, insert<_1, begin<_1>, _2>
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
typedef typename fold<
|
typedef typename reverse_fold<
|
||||||
joint_view<
|
joint_view<
|
||||||
iterator_range<typename begin<Sequence>::type,Pos>
|
iterator_range<typename begin<Sequence>::type,Pos>
|
||||||
, joint_view<
|
, joint_view<
|
||||||
@@ -67,7 +67,7 @@ struct insert_range_impl
|
|||||||
>
|
>
|
||||||
>
|
>
|
||||||
, typename clear<Sequence>::type
|
, typename clear<Sequence>::type
|
||||||
, insert<_1, end<_1>, _2>
|
, insert<_1, begin<_1>, _2>
|
||||||
>::type type;
|
>::type type;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user