mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 06:15:23 +02:00
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.
This commit is contained in:
@@ -14,9 +14,10 @@
|
|||||||
// $Date$
|
// $Date$
|
||||||
// $Revision$
|
// $Revision$
|
||||||
|
|
||||||
#include <boost/mpl/copy.hpp>
|
#include <boost/mpl/placeholders.hpp>
|
||||||
|
#include <boost/mpl/fold.hpp>
|
||||||
|
#include <boost/mpl/insert.hpp>
|
||||||
#include <boost/mpl/clear.hpp>
|
#include <boost/mpl/clear.hpp>
|
||||||
#include <boost/mpl/front_inserter.hpp>
|
|
||||||
#include <boost/mpl/joint_view.hpp>
|
#include <boost/mpl/joint_view.hpp>
|
||||||
#include <boost/mpl/iterator_range.hpp>
|
#include <boost/mpl/iterator_range.hpp>
|
||||||
#include <boost/mpl/aux_/na_spec.hpp>
|
#include <boost/mpl/aux_/na_spec.hpp>
|
||||||
@@ -43,29 +44,31 @@ struct insert_range_impl
|
|||||||
>
|
>
|
||||||
struct apply
|
struct apply
|
||||||
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
||||||
: reverse_copy<
|
: fold<
|
||||||
joint_view<
|
joint_view<
|
||||||
iterator_range<typename begin<Sequence>::type,Pos>
|
iterator_range<typename begin<Sequence>::type,Pos>
|
||||||
, joint_view<
|
, joint_view<
|
||||||
Range
|
Range
|
||||||
, iterator_range<Pos,typename end<Sequence>::type>
|
, iterator_range<Pos,typename end<Sequence>::type>
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
, front_inserter< typename clear<Sequence>::type >
|
, typename clear<Sequence>::type
|
||||||
|
, insert<_1, end<_1>, _2>
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
typedef typename reverse_copy<
|
typedef typename fold<
|
||||||
joint_view<
|
joint_view<
|
||||||
iterator_range<typename begin<Sequence>::type,Pos>
|
iterator_range<typename begin<Sequence>::type,Pos>
|
||||||
, joint_view<
|
, joint_view<
|
||||||
Range
|
Range
|
||||||
, iterator_range<Pos,typename end<Sequence>::type>
|
, iterator_range<Pos,typename end<Sequence>::type>
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
, front_inserter< typename clear<Sequence>::type >
|
, typename clear<Sequence>::type
|
||||||
>::type type;
|
, insert<_1, end<_1>, _2>
|
||||||
|
>::type type;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user