interval_set_value.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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_CONCEPT_INTERVAL_SET_VALUE_HPP_JOFA_100924
  9. #define BOOST_ICL_CONCEPT_INTERVAL_SET_VALUE_HPP_JOFA_100924
  10. #include <boost/utility/enable_if.hpp>
  11. #include <boost/icl/type_traits/is_interval_container.hpp>
  12. #include <boost/icl/concept/interval.hpp>
  13. namespace boost{ namespace icl
  14. {
  15. //==============================================================================
  16. //= AlgoUnifiers<Set>
  17. //==============================================================================
  18. template<class Type, class Iterator>
  19. inline typename enable_if<is_interval_set<Type>, typename Type::codomain_type>::type
  20. co_value(Iterator value_)
  21. {
  22. typedef typename Type::codomain_type codomain_type;
  23. return icl::is_empty(*value_)? codomain_type() : (*value_).lower();
  24. }
  25. }} // namespace boost icl
  26. #endif