fixing stuff
[dyninst.git] / dynutil / h / dyn_detail / boost / type_traits / is_array.hpp
1
2 //  (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
3 //  Hinnant & John Maddock 2000.  
4 //  Use, modification and distribution are subject to the Boost Software License,
5 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 //  http://www.boost.org/LICENSE_1_0.txt).
7 //
8 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
9
10
11 // Some fixes for is_array are based on a newgroup posting by Jonathan Lundquist.
12
13
14 #ifndef DYN_DETAIL_BOOST_TT_IS_ARRAY_HPP_INCLUDED
15 #define DYN_DETAIL_BOOST_TT_IS_ARRAY_HPP_INCLUDED
16
17 #include <dyn_detail/boost/type_traits/config.hpp>
18
19 #ifdef DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
20 #   include <dyn_detail/boost/type_traits/detail/yes_no_type.hpp>
21 #   include <dyn_detail/boost/type_traits/detail/wrap.hpp>
22 #endif
23
24 #include <cstddef>
25
26 // should be the last #include
27 #include <dyn_detail/boost/type_traits/detail/bool_trait_def.hpp>
28
29 namespace dyn_detail {
30 namespace boost {
31
32 #if defined( __CODEGEARC__ )
33 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,__is_array(T))
34 #elif !defined(DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
35 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false)
36 #if !defined(DYN_DETAIL_BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
37 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T[N],true)
38 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const[N],true)
39 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T volatile[N],true)
40 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const volatile[N],true)
41 #if !DYN_DETAIL_BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) &&  !DYN_DETAIL_BOOST_WORKAROUND(__DMC__, DYN_DETAIL_BOOST_TESTED_AT(0x840))
42 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T[],true)
43 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const[],true)
44 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T volatile[],true)
45 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const volatile[],true)
46 #endif
47 #endif
48
49 #else // DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
50
51 namespace detail {
52
53 using dyn_detail::boost::type_traits::yes_type;
54 using dyn_detail::boost::type_traits::no_type;
55 using dyn_detail::boost::type_traits::wrap;
56
57 template< typename T > T(* is_array_tester1(wrap<T>) )(wrap<T>);
58 char DYN_DETAIL_BOOST_TT_DECL is_array_tester1(...);
59
60 template< typename T> no_type is_array_tester2(T(*)(wrap<T>));
61 yes_type DYN_DETAIL_BOOST_TT_DECL is_array_tester2(...);
62
63 template< typename T >
64 struct is_array_impl
65
66     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, value = 
67         sizeof(dyn_detail::boost::detail::is_array_tester2(
68             dyn_detail::boost::detail::is_array_tester1(
69                 dyn_detail::boost::type_traits::wrap<T>()
70                 )
71         )) == 1
72     );
73 };
74
75 #ifndef DYN_DETAIL_BOOST_NO_CV_VOID_SPECIALIZATIONS
76 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_array,void,false)
77 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_array,void const,false)
78 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_array,void volatile,false)
79 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_array,void const volatile,false)
80 #endif
81
82 } // namespace detail
83
84 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,dyn_detail::boost::detail::is_array_impl<T>::value)
85
86 #endif // DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
87
88 } // namespace boost
89 } // namespace dyn_detail
90
91 #include <dyn_detail/boost/type_traits/detail/bool_trait_undef.hpp>
92
93 #endif // DYN_DETAIL_BOOST_TT_IS_ARRAY_HPP_INCLUDED