os/ossrv/ossrv_pub/boost_apis/boost/mpl/remove_if.hpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
sl@0
     2
#ifndef BOOST_MPL_REMOVE_IF_HPP_INCLUDED
sl@0
     3
#define BOOST_MPL_REMOVE_IF_HPP_INCLUDED
sl@0
     4
sl@0
     5
// Copyright Aleksey Gurtovoy 2000-2004
sl@0
     6
// Copyright David Abrahams 2003-2004
sl@0
     7
//
sl@0
     8
// Distributed under the Boost Software License, Version 1.0. 
sl@0
     9
// (See accompanying file LICENSE_1_0.txt or copy at 
sl@0
    10
// http://www.boost.org/LICENSE_1_0.txt)
sl@0
    11
//
sl@0
    12
// See http://www.boost.org/libs/mpl for documentation.
sl@0
    13
sl@0
    14
// $Source: /cvsroot/boost/boost/boost/mpl/remove_if.hpp,v $
sl@0
    15
// $Date: 2004/09/02 15:40:42 $
sl@0
    16
// $Revision: 1.7 $
sl@0
    17
sl@0
    18
#include <boost/mpl/fold.hpp>
sl@0
    19
#include <boost/mpl/reverse_fold.hpp>
sl@0
    20
#include <boost/mpl/eval_if.hpp>
sl@0
    21
#include <boost/mpl/identity.hpp>
sl@0
    22
#include <boost/mpl/protect.hpp>
sl@0
    23
#include <boost/mpl/lambda.hpp>
sl@0
    24
#include <boost/mpl/apply.hpp>
sl@0
    25
#include <boost/mpl/aux_/inserter_algorithm.hpp>
sl@0
    26
sl@0
    27
namespace boost { namespace mpl {
sl@0
    28
sl@0
    29
namespace aux {
sl@0
    30
sl@0
    31
template< typename Pred, typename InsertOp > struct remove_if_helper
sl@0
    32
{
sl@0
    33
    template< typename Sequence, typename U > struct apply
sl@0
    34
    {
sl@0
    35
        typedef typename eval_if<
sl@0
    36
              typename apply1<Pred,U>::type
sl@0
    37
            , identity<Sequence>
sl@0
    38
            , apply2<InsertOp,Sequence,U>
sl@0
    39
            >::type type;
sl@0
    40
    };
sl@0
    41
};
sl@0
    42
sl@0
    43
template<
sl@0
    44
      typename Sequence
sl@0
    45
    , typename Predicate
sl@0
    46
    , typename Inserter
sl@0
    47
    >
sl@0
    48
struct remove_if_impl
sl@0
    49
    : fold<
sl@0
    50
          Sequence
sl@0
    51
        , typename Inserter::state
sl@0
    52
        , protect< aux::remove_if_helper<
sl@0
    53
              typename lambda<Predicate>::type
sl@0
    54
            , typename Inserter::operation
sl@0
    55
            > >
sl@0
    56
        >
sl@0
    57
{
sl@0
    58
};
sl@0
    59
sl@0
    60
template<
sl@0
    61
      typename Sequence
sl@0
    62
    , typename Predicate
sl@0
    63
    , typename Inserter
sl@0
    64
    >
sl@0
    65
struct reverse_remove_if_impl
sl@0
    66
    : reverse_fold<
sl@0
    67
          Sequence
sl@0
    68
        , typename Inserter::state
sl@0
    69
        , protect< aux::remove_if_helper<
sl@0
    70
              typename lambda<Predicate>::type
sl@0
    71
            , typename Inserter::operation
sl@0
    72
            > >
sl@0
    73
        >
sl@0
    74
{
sl@0
    75
};
sl@0
    76
sl@0
    77
} // namespace aux
sl@0
    78
sl@0
    79
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove_if)
sl@0
    80
sl@0
    81
}}
sl@0
    82
sl@0
    83
#endif // BOOST_MPL_REMOVE_IF_HPP_INCLUDED