is_asymmetric_interval.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*-----------------------------------------------------------------------------+
  2. Copyright (c) 2010-2010: 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_ASYMMETRIC_INTERVAL_HPP_JOFA_100327
  9. #define BOOST_ICL_TYPE_TRAITS_IS_ASYMMETRIC_INTERVAL_HPP_JOFA_100327
  10. #include <boost/icl/type_traits/is_interval.hpp>
  11. namespace boost{ namespace icl
  12. {
  13. template <class Type> struct is_asymmetric_interval
  14. {
  15. typedef is_asymmetric_interval<Type> type;
  16. BOOST_STATIC_CONSTANT(bool,
  17. value = (mpl::and_<
  18. is_interval<Type>
  19. , has_static_bounds<Type>
  20. , has_asymmetric_bounds<Type>
  21. >::value)
  22. );
  23. };
  24. template <class Type> struct is_continuous_asymmetric
  25. {
  26. typedef is_continuous_asymmetric<Type> type;
  27. BOOST_STATIC_CONSTANT(bool,
  28. value = (mpl::and_<
  29. is_asymmetric_interval<Type>
  30. , is_continuous<typename domain_type_of<interval_traits<Type> >::type>
  31. >::value)
  32. );
  33. };
  34. template <class Type> struct is_discrete_asymmetric
  35. {
  36. typedef is_discrete_asymmetric<Type> type;
  37. BOOST_STATIC_CONSTANT(bool,
  38. value = (mpl::and_<
  39. is_asymmetric_interval<Type>
  40. , mpl::not_<is_continuous<typename domain_type_of<interval_traits<Type> >::type> >
  41. >::value)
  42. );
  43. };
  44. }} // namespace boost icl
  45. #endif