From c7798600d67acb49d398ebe90e9d7e2fcfe5738c Mon Sep 17 00:00:00 2001 From: Bruno Dutra Date: Mon, 9 Feb 2015 20:48:55 -0200 Subject: [PATCH] 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. --- include/boost/mpl/aux_/insert_range_impl.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/mpl/aux_/insert_range_impl.hpp b/include/boost/mpl/aux_/insert_range_impl.hpp index 4595468..fa43315 100644 --- a/include/boost/mpl/aux_/insert_range_impl.hpp +++ b/include/boost/mpl/aux_/insert_range_impl.hpp @@ -44,7 +44,7 @@ struct insert_range_impl > struct apply #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) - : fold< + : reverse_fold< joint_view< iterator_range::type,Pos> , joint_view< @@ -53,12 +53,12 @@ struct insert_range_impl > > , typename clear::type - , insert<_1, end<_1>, _2> + , insert<_1, begin<_1>, _2> > { #else { - typedef typename fold< + typedef typename reverse_fold< joint_view< iterator_range::type,Pos> , joint_view< @@ -67,7 +67,7 @@ struct insert_range_impl > > , typename clear::type - , insert<_1, end<_1>, _2> + , insert<_1, begin<_1>, _2> >::type type; #endif };