]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/icl/include/boost/icl/type_traits/interval_type_of.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / icl / include / boost / icl / type_traits / interval_type_of.hpp
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
10
11 #include <boost/mpl/has_xxx.hpp>
12 #include <boost/mpl/bool.hpp>
13 #include <boost/icl/type_traits/no_type.hpp>
14
15 namespace boost{ namespace icl
16 {
17 namespace detail
18 {
19 BOOST_MPL_HAS_XXX_TRAIT_DEF(interval_type)
20 }
21
22 template <class Type>
23 struct has_interval_type
24 : mpl::bool_<detail::has_interval_type<Type>::value>
25 {};
26
27 template <class Type, bool has_interval_type>
28 struct get_interval_type;
29
30 template <class Type>
31 struct get_interval_type<Type, false>
32 {
33 typedef no_type type;
34 };
35
36 template <class Type>
37 struct get_interval_type<Type, true>
38 {
39 typedef typename Type::interval_type type;
40 };
41
42 template <class Type>
43 struct interval_type_of
44 {
45 typedef typename
46 get_interval_type<Type, has_interval_type<Type>::value>::type type;
47 };
48
49 }} // namespace boost icl
50
51 #endif
52
53