erase_key_impl.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef BOOST_MPL_MAP_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
  2. #define BOOST_MPL_MAP_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2003-2004
  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/map/aux_/has_key_impl.hpp>
  16. #include <boost/mpl/map/aux_/item.hpp>
  17. #include <boost/mpl/map/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::map_tag >
  25. {
  26. template<
  27. typename Map
  28. , typename Key
  29. >
  30. struct apply
  31. : eval_if<
  32. has_key_impl<aux::map_tag>::apply<Map,Key>
  33. , eval_if<
  34. is_same< Key,typename Map::key_ >
  35. , base<Map>
  36. , identity< m_mask<Key,Map> >
  37. >
  38. , identity<Map>
  39. >
  40. {
  41. };
  42. };
  43. }}
  44. #endif // BOOST_MPL_MAP_AUX_ERASE_KEY_IMPL_HPP_INCLUDED