erase_key_impl.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
  2. #define BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2003-2007
  4. // Copyright David Abrahams 2003-2004
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See http://www.boost.org/libs/mpl for documentation.
  11. // $Id$
  12. // $Date$
  13. // $Revision$
  14. #include <boost/mpl/erase_key_fwd.hpp>
  15. #include <boost/mpl/set/aux_/has_key_impl.hpp>
  16. #include <boost/mpl/set/aux_/item.hpp>
  17. #include <boost/mpl/set/aux_/tag.hpp>
  18. #include <boost/mpl/identity.hpp>
  19. #include <boost/mpl/base.hpp>
  20. #include <boost/mpl/eval_if.hpp>
  21. #include <boost/type_traits/is_same.hpp>
  22. namespace boost { namespace mpl {
  23. template<>
  24. struct erase_key_impl< aux::set_tag >
  25. {
  26. template<
  27. typename Set
  28. , typename T
  29. >
  30. struct apply
  31. : eval_if<
  32. has_key_impl<aux::set_tag>::apply<Set,T>
  33. , eval_if<
  34. is_same< T,typename Set::item_type_ >
  35. , base<Set>
  36. , identity< s_mask<T,typename Set::item_> >
  37. >
  38. , identity<Set>
  39. >
  40. {
  41. };
  42. };
  43. }}
  44. #endif // BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED