/Src/Dependencies/Boost/boost/fusion/algorithm/transformation/erase_key.hpp

http://hadesmem.googlecode.com/ · C++ Header · 34 lines · 23 code · 5 blank · 6 comment · 0 complexity · 02ce7cf0485aa2929fb80675d9dc668e MD5 · raw file

  1. /*=============================================================================
  2. Copyright (c) 2001-2006 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #if !defined(FUSION_ERASE_KEY_10022005_1851)
  7. #define FUSION_ERASE_KEY_10022005_1851
  8. #include <boost/fusion/algorithm/query/find.hpp>
  9. #include <boost/fusion/algorithm/transformation/erase.hpp>
  10. #include <boost/mpl/not.hpp>
  11. #include <boost/type_traits/is_same.hpp>
  12. namespace boost { namespace fusion
  13. {
  14. namespace result_of
  15. {
  16. template <typename Sequence, typename Key>
  17. struct erase_key
  18. : erase<Sequence, typename find<Sequence, Key>::type>
  19. {};
  20. }
  21. template <typename Key, typename Sequence>
  22. inline typename result_of::erase_key<Sequence const, Key>::type
  23. erase_key(Sequence const& seq)
  24. {
  25. return erase(seq, find<Key>(seq));
  26. }
  27. }}
  28. #endif