1 // Copyright (C) 2004 Peder Holt
2 // Use, modification and distribution is subject to the Boost Software
3 // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827
6 #define BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827
8 #include <boost/type_traits/msvc/typeof.hpp>
9 #include <boost/type_traits/is_array.hpp>
13 template<bool IsArray>
14 struct remove_bounds_impl_typeof {
15 template<typename T,typename ID>
21 struct remove_bounds_impl_typeof<true> {
22 template<typename T,typename ID>
25 static msvc_register_type<U,ID> test(U[]);
26 static msvc_register_type<T,ID> test(...);
27 BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) ));
28 typedef typename msvc_extract_type<ID>::id2type::type type;
34 struct remove_bounds {
35 typedef typename boost::detail::remove_bounds_impl_typeof<
36 boost::is_array<T>::value
37 >::template inner<T,remove_bounds<T> >::type type;
38 BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_bounds,T)
42 #endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827