
#ifndef BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED

// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0. 
// (See accompanying file LICENSE_1_0.txt or copy at 
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.

// $Source: /cvsroot/boost/boost/boost/mpl/set/aux_/erase_key_impl.hpp,v $
// $Date: 2004/09/02 15:41:02 $
// $Revision: 1.2 $

#include <dkutil/boost/mpl/erase_key_fwd.hpp>
#include <dkutil/boost/mpl/set/aux_/has_key_impl.hpp>
#include <dkutil/boost/mpl/set/aux_/item.hpp>
#include <dkutil/boost/mpl/set/aux_/tag.hpp>
#include <dkutil/boost/mpl/identity.hpp>
#include <dkutil/boost/mpl/base.hpp>
#include <dkutil/boost/mpl/eval_if.hpp>

#include <dkutil/boost/type_traits/is_same.hpp>

namespace boost { namespace mpl {

template<>
struct erase_key_impl< aux::set_tag >
{
    template< 
          typename Set
        , typename T
        > 
    struct apply
        : eval_if< 
              has_key_impl<aux::set_tag>::apply<Set,T>
            , eval_if< 
                  is_same< T,typename Set::item_type_ > 
                , base<Set>
                , identity< s_mask<T,Set> >
                >
            , identity<Set>
            >
    {
    };
};

}}

#endif // BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
