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_JOINABLE_HPP_JOFA_100920 9 #define BOOST_ICL_CONCEPT_JOINABLE_HPP_JOFA_100920 10 11 #include <boost/icl/type_traits/is_interval_container.hpp> 12 #include <boost/icl/concept/interval.hpp> 13 14 namespace boost{ namespace icl 15 { 16 17 namespace segmental 18 { 19 template<class Type> 20 typename enable_if<is_interval_set<Type>, bool>::type is_joinable(typename Type::iterator it_,typename Type::iterator next_,Type * =0)21 is_joinable(typename Type::iterator it_, typename Type::iterator next_, Type* = 0) 22 { 23 return touches(*it_, *next_); 24 } 25 26 template<class Type> 27 typename enable_if<is_interval_map<Type>, bool>::type is_joinable(typename Type::iterator it_,typename Type::iterator next_,Type * =0)28 is_joinable(typename Type::iterator it_, typename Type::iterator next_, Type* = 0) 29 { 30 return touches((*it_).first, (*next_).first) 31 && (*it_).second == (*next_).second ; 32 } 33 } 34 35 36 37 }} // namespace boost icl 38 39 #endif 40 41 42