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_SEGMENT_TYPE_OF_HPP_JOFA_100902
9 #define BOOST_ICL_TYPE_TRAITS_SEGMENT_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(segment_type)
23 struct has_segment_type
24 : mpl::bool_<detail::has_segment_type<Type>::value>
27 template <class Type, bool has_segment_type>
28 struct get_segment_type;
31 struct get_segment_type<Type, false>
37 struct get_segment_type<Type, true>
39 typedef typename Type::segment_type type;
43 struct segment_type_of
46 get_segment_type<Type, has_segment_type<Type>::value>::type type;
49 }} // namespace boost icl