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

http://hadesmem.googlecode.com/ · C++ Header · 35 lines · 24 code · 5 blank · 6 comment · 0 complexity · 6d86ca3e2333f4168107f56cf494a0cc 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_REMOVE_07162005_0818)
  7. #define FUSION_REMOVE_07162005_0818
  8. #include <boost/fusion/view/filter_view/filter_view.hpp>
  9. #include <boost/mpl/not.hpp>
  10. #include <boost/type_traits/is_same.hpp>
  11. namespace boost { namespace fusion
  12. {
  13. namespace result_of
  14. {
  15. template <typename Sequence, typename T>
  16. struct remove
  17. {
  18. typedef filter_view<Sequence, mpl::not_<is_same<mpl::_, T> > > type;
  19. };
  20. }
  21. template <typename T, typename Sequence>
  22. inline typename result_of::remove<Sequence const, T>::type
  23. remove(Sequence const& seq)
  24. {
  25. typedef typename result_of::remove<Sequence const, T>::type result_type;
  26. return result_type(seq);
  27. }
  28. }}
  29. #endif