From 3308f93b333188f8ff5480cb44e971e561368eeb Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 2 Jun 2006 17:52:15 +0000 Subject: [PATCH] Fix header include name: was a duplicate used elsewhere. [SVN r34144] --- .../boost/type_traits/remove_all_extents.hpp | 79 +++++++++---------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/include/boost/type_traits/remove_all_extents.hpp b/include/boost/type_traits/remove_all_extents.hpp index 8ae18ee..3517132 100755 --- a/include/boost/type_traits/remove_all_extents.hpp +++ b/include/boost/type_traits/remove_all_extents.hpp @@ -1,48 +1,47 @@ +// 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) -// (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. +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827 -#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) +#include +#include namespace boost { + template + struct remove_all_extents; -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_all_extents,T,T) + 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 -#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 + 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 -} // namespace boost +#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827 -#endif - -#include - -#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED