remove.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 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/support/config.hpp>
  9. #include <boost/fusion/view/filter_view/filter_view.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 T>
  17. struct remove
  18. {
  19. typedef filter_view<Sequence, mpl::not_<is_same<mpl::_, T> > > type;
  20. };
  21. }
  22. template <typename T, typename Sequence>
  23. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  24. inline typename result_of::remove<Sequence const, T>::type
  25. remove(Sequence const& seq)
  26. {
  27. typedef typename result_of::remove<Sequence const, T>::type result_type;
  28. return result_type(seq);
  29. }
  30. }}
  31. #endif