not_equal_to.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*=============================================================================
  2. Copyright (c) 1999-2003 Jaakko Jarvi
  3. Copyright (c) 2001-2011 Joel de Guzman
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #if !defined(FUSION_NOT_EQUAL_TO_05052005_0431)
  8. #define FUSION_NOT_EQUAL_TO_05052005_0431
  9. #include <boost/fusion/support/config.hpp>
  10. #include <boost/fusion/sequence/intrinsic/begin.hpp>
  11. #include <boost/fusion/sequence/intrinsic/end.hpp>
  12. #include <boost/fusion/sequence/intrinsic/size.hpp>
  13. #include <boost/fusion/sequence/comparison/enable_comparison.hpp>
  14. #if defined(FUSION_DIRECT_OPERATOR_USAGE)
  15. #include <boost/fusion/sequence/comparison/detail/not_equal_to.hpp>
  16. #else
  17. #include <boost/fusion/sequence/comparison/equal_to.hpp>
  18. #endif
  19. namespace boost { namespace fusion
  20. {
  21. template <typename Seq1, typename Seq2>
  22. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  23. inline bool
  24. not_equal_to(Seq1 const& a, Seq2 const& b)
  25. {
  26. #if defined(FUSION_DIRECT_OPERATOR_USAGE)
  27. return result_of::size<Seq1>::value != result_of::size<Seq2>::value
  28. || detail::sequence_not_equal_to<
  29. Seq1 const, Seq2 const
  30. , result_of::size<Seq1>::value == result_of::size<Seq2>::value>::
  31. call(fusion::begin(a), fusion::begin(b));
  32. #else
  33. return !(a == b);
  34. #endif
  35. }
  36. namespace operators
  37. {
  38. template <typename Seq1, typename Seq2>
  39. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  40. inline typename
  41. boost::enable_if<
  42. traits::enable_equality<Seq1, Seq2>
  43. , bool
  44. >::type
  45. operator!=(Seq1 const& a, Seq2 const& b)
  46. {
  47. return fusion::not_equal_to(a, b);
  48. }
  49. }
  50. using operators::operator!=;
  51. }}
  52. #endif