From cc9fd8a34ebe39f3d8072995fb3ab5886219b79d Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 3 Jun 2006 11:25:54 +0000 Subject: [PATCH] Fixed previous commit which was pretty well messed up! [SVN r34151] --- .../type_traits/msvc/remove_all_extents.hpp | 4 +- .../boost/type_traits/remove_all_extents.hpp | 79 ++++++++++--------- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/include/boost/type_traits/msvc/remove_all_extents.hpp b/include/boost/type_traits/msvc/remove_all_extents.hpp index b5424a6..3517132 100644 --- a/include/boost/type_traits/msvc/remove_all_extents.hpp +++ b/include/boost/type_traits/msvc/remove_all_extents.hpp @@ -2,8 +2,8 @@ // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827 -#define BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827 +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827 #include #include diff --git a/include/boost/type_traits/remove_all_extents.hpp b/include/boost/type_traits/remove_all_extents.hpp index 3517132..8ae18ee 100755 --- a/include/boost/type_traits/remove_all_extents.hpp +++ b/include/boost/type_traits/remove_all_extents.hpp @@ -1,47 +1,48 @@ -// Copyright (C) 2004 Peder Holt -// Use, modification and distribution is subject to the Boost Software -// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827 -#define BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827 +// (C) Copyright John Maddock 2005. +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. -#include -#include +#ifndef BOOST_TT_REMOVE_ALL_EXTENTS_HPP_INCLUDED +#define BOOST_TT_REMOVE_ALL_EXTENTS_HPP_INCLUDED + +#include +#include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif + +// should be the last #include +#include + +#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300) namespace boost { - template - struct remove_all_extents; - namespace detail { - template - struct remove_all_extents_impl_typeof { - template - struct inner { - typedef T type; - }; - }; - template<> - struct remove_all_extents_impl_typeof { - template - struct inner { - template - static msvc_register_type test(U[]); - static msvc_register_type test(...); - BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) )); - typedef typename msvc_extract_type::id2type::type reduced_type; - typedef typename remove_all_extents::type type; - }; - }; - } //namespace detail +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_all_extents,T,T) - template - struct remove_all_extents { - typedef typename detail::remove_all_extents_impl_typeof< - boost::is_array::value - >::template inner >::type type; - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_all_extents,T) - }; -} //namespace boost +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T[N],typename boost::remove_all_extents::type type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T const[N],typename boost::remove_all_extents::type type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T volatile[N],typename boost::remove_all_extents::type type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T const volatile[N],typename boost::remove_all_extents::type type) +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T[],typename boost::remove_all_extents::type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const[],typename boost::remove_all_extents::type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T volatile[],typename boost::remove_all_extents::type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const volatile[],typename boost::remove_all_extents::type) +#endif +#endif -#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827 +} // namespace boost +#endif + +#include + +#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED