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_INTERVAL_TYPE_OF_HPP_JOFA_100910
9 #define BOOST_ICL_TYPE_TRAITS_INTERVAL_TYPE_OF_HPP_JOFA_100910
11 #include <boost/mpl/has_xxx.hpp>
12 #include <boost/mpl/bool.hpp>
13 #include <boost/icl/type_traits/no_type.hpp>
15 namespace boost{ namespace icl
19 BOOST_MPL_HAS_XXX_TRAIT_DEF(interval_type)
23 struct has_interval_type
24 : mpl::bool_<detail::has_interval_type<Type>::value>
27 template <class Type, bool has_interval_type>
28 struct get_interval_type;
31 struct get_interval_type<Type, false>
37 struct get_interval_type<Type, true>
39 typedef typename Type::interval_type type;
43 struct interval_type_of
46 get_interval_type<Type, has_interval_type<Type>::value>::type type;
49 }} // namespace boost icl