Chris@16: /*-----------------------------------------------------------------------------+ Chris@16: Copyright (c) 2010-2010: Joachim Faulhaber Chris@16: +------------------------------------------------------------------------------+ Chris@16: Distributed under the Boost Software License, Version 1.0. Chris@16: (See accompanying file LICENCE.txt or copy at Chris@16: http://www.boost.org/LICENSE_1_0.txt) Chris@16: +-----------------------------------------------------------------------------*/ Chris@16: #ifndef BOOST_ICL_INTERVAL_TRAITS_HPP_JOFA_100926 Chris@16: #define BOOST_ICL_INTERVAL_TRAITS_HPP_JOFA_100926 Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost{ namespace icl Chris@16: { Chris@16: Chris@16: template struct interval_traits; Chris@16: Chris@16: template Chris@16: struct domain_type_of > Chris@16: { Chris@16: typedef typename interval_traits::domain_type type; Chris@16: }; Chris@16: Chris@16: //------------------------------------------------------------------------------ Chris@16: //- Adapter class Chris@16: //------------------------------------------------------------------------------ Chris@16: template struct interval_traits Chris@16: { Chris@16: typedef interval_traits type; Chris@16: typedef typename domain_type_of::type domain_type; Chris@16: Chris@16: static Type construct(const domain_type& lo, const domain_type& up); Chris@16: Chris@16: static domain_type upper(const Type& inter_val); Chris@16: static domain_type lower(const Type& inter_val); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct difference_type_of > Chris@16: { Chris@16: typedef typename interval_traits::domain_type domain_type; Chris@16: typedef typename difference_type_of::type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct size_type_of > Chris@16: { Chris@16: typedef typename interval_traits::domain_type domain_type; Chris@16: typedef typename size_type_of::type type; Chris@16: }; Chris@16: Chris@16: }} // namespace boost icl Chris@16: Chris@16: #endif Chris@16: Chris@16: