]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/icl/include/boost/icl/type_traits/domain_type_of.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / icl / include / boost / icl / type_traits / domain_type_of.hpp
1 /*-----------------------------------------------------------------------------+
2 Copyright (c) 2008-2009: 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_DOMAIN_TYPE_OF_HPP_JOFA_100902
9 #define BOOST_ICL_TYPE_TRAITS_DOMAIN_TYPE_OF_HPP_JOFA_100902
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(domain_type)
20 }
21
22 template <class Type>
23 struct has_domain_type
24 : mpl::bool_<detail::has_domain_type<Type>::value>
25 {};
26
27
28 template <class Type, bool has_domain_type>
29 struct get_domain_type;
30
31 template <class Type>
32 struct get_domain_type<Type, false>
33 {
34 typedef no_type type;
35 };
36
37 template <class Type>
38 struct get_domain_type<Type, true>
39 {
40 typedef typename Type::domain_type type;
41 };
42
43 template <class Type>
44 struct domain_type_of
45 {
46 typedef typename
47 get_domain_type<Type, has_domain_type<Type>::value>::type type;
48 };
49
50 }} // namespace boost icl
51
52 #endif
53
54