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_CODOMAIN_TYPE_OF_HPP_JOFA_100829
9 #define BOOST_ICL_TYPE_TRAITS_CODOMAIN_TYPE_OF_HPP_JOFA_100829
12 #include <boost/mpl/has_xxx.hpp>
13 #include <boost/mpl/bool.hpp>
14 #include <boost/icl/type_traits/no_type.hpp>
15 #include <boost/icl/type_traits/is_container.hpp>
17 namespace boost{ namespace icl
21 BOOST_MPL_HAS_XXX_TRAIT_DEF(codomain_type)
25 struct has_codomain_type
26 : mpl::bool_<detail::has_codomain_type<Type>::value>
29 template <class Type, bool has_codomain_type, bool is_std_set>
30 struct get_codomain_type;
33 struct get_codomain_type<Type, false, false>
38 template <class Type, bool is_std_set>
39 struct get_codomain_type<Type, true, is_std_set>
41 typedef typename Type::codomain_type type;
45 struct get_codomain_type<Type, false, true>
47 typedef typename Type::value_type type;
51 struct codomain_type_of
54 get_codomain_type< Type
55 , has_codomain_type<Type>::value
56 , is_std_set<Type>::value
60 }} // namespace boost icl