From 1c02715e4990299d37dea1fb32bcca6f1e927cd4 Mon Sep 17 00:00:00 2001 From: Bruno Dutra Date: Mon, 9 Feb 2015 00:04:07 -0200 Subject: [PATCH] Fix to bug 11001 According to reference, insert_range should work for any Extensible sequence or Extensible Associative sequence, but the default implementation of insert_range_impl assumes a front_inserter is defined for the given sequence, but neither Extensible nor every Extensible Associative sequences are required to also be a Front Extensible sequence. This fix rely only on insert, which is defined for every Extensible sequence. --- include/boost/mpl/aux_/insert_range_impl.hpp | 35 +++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/include/boost/mpl/aux_/insert_range_impl.hpp b/include/boost/mpl/aux_/insert_range_impl.hpp index baffb54..4595468 100644 --- a/include/boost/mpl/aux_/insert_range_impl.hpp +++ b/include/boost/mpl/aux_/insert_range_impl.hpp @@ -14,9 +14,10 @@ // $Date$ // $Revision$ -#include +#include +#include +#include #include -#include #include #include #include @@ -43,29 +44,31 @@ struct insert_range_impl > struct apply #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) - : reverse_copy< - joint_view< + : fold< + joint_view< iterator_range::type,Pos> - , joint_view< + , joint_view< Range , iterator_range::type> > > - , front_inserter< typename clear::type > + , typename clear::type + , insert<_1, end<_1>, _2> > { #else { - typedef typename reverse_copy< - joint_view< - iterator_range::type,Pos> - , joint_view< - Range - , iterator_range::type> - > - > - , front_inserter< typename clear::type > - >::type type; + typedef typename fold< + joint_view< + iterator_range::type,Pos> + , joint_view< + Range + , iterator_range::type> + > + > + , typename clear::type + , insert<_1, end<_1>, _2> + >::type type; #endif }; };