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_ALL_EXTENT_HOLT_2004_0827
6
#define BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827
8
#include <boost/type_traits/msvc/typeof.hpp>
9
#include <boost/type_traits/is_array.hpp>
13
struct remove_all_extents;
16
template<bool IsArray>
17
struct remove_all_extents_impl_typeof {
18
template<typename T,typename ID>
24
struct remove_all_extents_impl_typeof<true> {
25
template<typename T,typename ID>
28
static msvc_register_type<U,ID> test(U[]);
29
static msvc_register_type<T,ID> test(...);
30
BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) ));
31
typedef typename msvc_extract_type<ID>::id2type::type reduced_type;
32
typedef typename remove_all_extents<reduced_type>::type type;
38
struct remove_all_extents {
39
typedef typename boost::detail::remove_all_extents_impl_typeof<
40
boost::is_array<T>::value
41
>::template inner<T,remove_all_extents<T> >::type type;
42
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_all_extents,T)
46
#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827