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
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(domain_type)
23 struct has_domain_type
24 : mpl::bool_<detail::has_domain_type<Type>::value>
28 template <class Type, bool has_domain_type>
29 struct get_domain_type;
32 struct get_domain_type<Type, false>
38 struct get_domain_type<Type, true>
40 typedef typename Type::domain_type type;
47 get_domain_type<Type, has_domain_type<Type>::value>::type type;
50 }} // namespace boost icl