less.hpp 1.4 KB

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