enable_comparison.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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_ENABLE_COMPARISON_09232005_1958)
  7. #define FUSION_ENABLE_COMPARISON_09232005_1958
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/mpl/or.hpp>
  10. #include <boost/mpl/and.hpp>
  11. #include <boost/mpl/not.hpp>
  12. #include <boost/mpl/equal_to.hpp>
  13. #include <boost/fusion/support/sequence_base.hpp>
  14. #include <boost/fusion/support/is_sequence.hpp>
  15. #include <boost/fusion/sequence/intrinsic/size.hpp>
  16. namespace boost { namespace fusion { namespace traits
  17. {
  18. template <typename Seq1, typename Seq2, typename Enable = void>
  19. struct enable_equality
  20. : mpl::or_<traits::is_sequence<Seq1>, traits::is_sequence<Seq2> >
  21. {};
  22. template <typename Seq1, typename Seq2, typename Enable = void>
  23. struct enable_comparison
  24. : mpl::and_<
  25. mpl::or_<traits::is_sequence<Seq1>, traits::is_sequence<Seq2> >
  26. , mpl::equal_to<result_of::size<Seq1>, result_of::size<Seq2> >
  27. >
  28. {};
  29. }}}
  30. #endif