is_interval_container.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*-----------------------------------------------------------------------------+
  2. Copyright (c) 2008-2009: Joachim Faulhaber
  3. +------------------------------------------------------------------------------+
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENCE.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. +-----------------------------------------------------------------------------*/
  8. #ifndef BOOST_ICL_TYPE_TRAITS_IS_INTERVAL_CONTAINER_HPP_JOFA_081004
  9. #define BOOST_ICL_TYPE_TRAITS_IS_INTERVAL_CONTAINER_HPP_JOFA_081004
  10. #include <boost/mpl/and.hpp>
  11. #include <boost/mpl/not.hpp>
  12. #include <boost/icl/type_traits/is_map.hpp>
  13. namespace boost{ namespace icl
  14. {
  15. template <class Type> struct is_interval_container
  16. {
  17. typedef is_interval_container<Type> type;
  18. BOOST_STATIC_CONSTANT(bool, value = false);
  19. };
  20. template<class Type>
  21. struct is_interval_map
  22. {
  23. typedef is_interval_map<Type> type;
  24. BOOST_STATIC_CONSTANT(bool, value =
  25. (mpl::and_<is_interval_container<Type>, is_map<Type> >::value)
  26. );
  27. };
  28. template<class Type>
  29. struct is_interval_set
  30. {
  31. typedef is_interval_set<Type> type;
  32. BOOST_STATIC_CONSTANT(bool, value =
  33. (mpl::and_< is_interval_container<Type>,
  34. mpl::not_<is_interval_map<Type> > >::value)
  35. );
  36. };
  37. }} // namespace boost icl
  38. #endif