Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/icl/interval_traits.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*-----------------------------------------------------------------------------+    
0002 Copyright (c) 2010-2010: Joachim Faulhaber
0003 +------------------------------------------------------------------------------+
0004    Distributed under the Boost Software License, Version 1.0.
0005       (See accompanying file LICENCE.txt or copy at
0006            http://www.boost.org/LICENSE_1_0.txt)
0007 +-----------------------------------------------------------------------------*/
0008 #ifndef BOOST_ICL_INTERVAL_TRAITS_HPP_JOFA_100926
0009 #define BOOST_ICL_INTERVAL_TRAITS_HPP_JOFA_100926
0010 
0011 #include <boost/icl/type_traits/domain_type_of.hpp>
0012 #include <boost/icl/type_traits/difference_type_of.hpp>
0013 #include <boost/icl/type_traits/size_type_of.hpp>
0014 
0015 namespace boost{ namespace icl
0016 {
0017 
0018 template<class Type> struct interval_traits;
0019 
0020 template<class Type>
0021 struct domain_type_of<interval_traits<Type> >
0022 {
0023     typedef typename interval_traits<Type>::domain_type type;
0024 };
0025 
0026 //------------------------------------------------------------------------------
0027 //- Adapter class
0028 //------------------------------------------------------------------------------
0029 template<class Type> struct interval_traits
0030 {
0031     typedef interval_traits                     type;
0032     typedef typename domain_type_of<Type>::type domain_type;
0033 
0034     static Type construct(const domain_type& lo, const domain_type& up);
0035 
0036     static domain_type upper(const Type& inter_val);
0037     static domain_type lower(const Type& inter_val);
0038 };
0039 
0040 template<class Type>
0041 struct difference_type_of<interval_traits<Type> >
0042 {
0043     typedef typename interval_traits<Type>::domain_type domain_type;
0044     typedef typename difference_type_of<domain_type>::type type;
0045 };
0046 
0047 template<class Type>
0048 struct size_type_of<interval_traits<Type> >
0049 {
0050     typedef typename interval_traits<Type>::domain_type domain_type;
0051     typedef typename size_type_of<domain_type>::type type;
0052 };
0053 
0054 }} // namespace boost icl
0055 
0056 #endif
0057 
0058