/*-----------------------------------------------------------------------------+ Copyright (c) 2008-2009: Joachim Faulhaber +------------------------------------------------------------------------------+ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENCE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +-----------------------------------------------------------------------------*/ #ifndef BOOST_ICL_TYPE_TRAITS_SIZE_TYPE_OF_HPP_JOFA_080911 #define BOOST_ICL_TYPE_TRAITS_SIZE_TYPE_OF_HPP_JOFA_080911 #include #include namespace boost{ namespace icl { namespace detail { BOOST_MPL_HAS_XXX_TRAIT_DEF(size_type) } //-------------------------------------------------------------------------- template struct has_size_type : mpl::bool_::value> {}; //-------------------------------------------------------------------------- template struct get_size_type; template struct get_size_type { typedef std::size_t type; }; template struct get_size_type { typedef typename Type::size_type type; }; template struct get_size_type { typedef typename Type::difference_type type; }; template struct get_size_type { typedef Type type; }; //-------------------------------------------------------------------------- template struct size_type_of { typedef typename get_size_type< Type , has_size_type::value , has_difference_type::value , has_rep_type::value >::type type; }; }} // namespace boost icl #endif