less.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_LESS_05052005_0432)
  8. #define FUSION_LESS_05052005_0432
  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/detail/less.hpp>
  14. #include <boost/fusion/sequence/comparison/enable_comparison.hpp>
  15. namespace boost { namespace fusion
  16. {
  17. template <typename Seq1, typename Seq2>
  18. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  19. inline bool
  20. less(Seq1 const& a, Seq2 const& b)
  21. {
  22. return detail::sequence_less<Seq1 const, Seq2 const>::
  23. call(fusion::begin(a), fusion::begin(b));
  24. }
  25. namespace operators
  26. {
  27. template <typename Seq1, typename Seq2>
  28. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  29. inline typename
  30. boost::enable_if<
  31. traits::enable_comparison<Seq1, Seq2>
  32. , bool
  33. >::type
  34. operator<(Seq1 const& a, Seq2 const& b)
  35. {
  36. return fusion::less(a, b);
  37. }
  38. }
  39. using operators::operator<;
  40. }}
  41. #endif