1
//-----------------------------------------------------------------------------
2
// boost mpl/insert_range_impl.hpp header file
3
// See http://www.boost.org for updates, documentation, and revision history.
4
//-----------------------------------------------------------------------------
6
// Copyright (c) 2000-02
9
// Permission to use, copy, modify, distribute and sell this software
10
// and its documentation for any purpose is hereby granted without fee,
11
// provided that the above copyright notice appears in all copies and
12
// that both the copyright notice and this permission notice appear in
13
// supporting documentation. No representations are made about the
14
// suitability of this software for any purpose. It is provided "as is"
15
// without express or implied warranty.
17
#ifndef BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
18
#define BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
20
#include "boost/mpl/iter_fold_backward.hpp"
21
#include "boost/mpl/fold_backward.hpp"
22
#include "boost/mpl/clear.hpp"
23
#include "boost/mpl/push_front.hpp"
24
#include "boost/mpl/identity.hpp"
25
#include "boost/mpl/apply_if.hpp"
26
#include "boost/mpl/aux_/void_spec.hpp"
27
#include "boost/mpl/aux_/iter_push_front.hpp"
28
#include "boost/mpl/aux_/traits_lambda_spec.hpp"
29
#include "boost/type_traits/same_traits.hpp"
34
// default implementation; conrete sequences might override it by
35
// specializing either the |insert_range_traits| or the primary
36
// |insert_range| template
44
struct iter_range_inserter
46
template< typename Sequence, typename Iterator > struct apply
48
typedef typename aux::iter_push_front<
50
is_same<Pos,typename Iterator::next>
51
, fold_backward< Range, Sequence, push_front<_,_> >
62
template< typename Tag >
63
struct insert_range_traits
72
typedef typename iter_fold_backward<
74
, typename clear<Sequence>::type
75
, aux::iter_range_inserter<Pos,Range>
80
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(3,insert_range_traits)
85
#endif // BOOST_MPL_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED