1.1 --- a/epoc32/include/stdapis/boost/serialization/is_abstract.hpp Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/boost/serialization/is_abstract.hpp Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,137 +1,52 @@
1.4 -#ifndef BOOST_TT_IS_ABSTRACT_CLASS_HPP
1.5 -#define BOOST_TT_IS_ABSTRACT_CLASS_HPP
1.6 +#ifndef BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
1.7 +#define BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
1.8
1.9 +// MS compatible compilers support #pragma once
1.10 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
1.11 # pragma once
1.12 #endif
1.13
1.14 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
1.15 // is_abstract_class.hpp:
1.16 -//
1.17 -// (C) Copyright 2002 Rani Sharoni (rani_sharoni@hotmail.com) and Robert Ramey
1.18 -// Use, modification and distribution is subject to the Boost Software
1.19 -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1.20 -// http://www.boost.org/LICENSE_1_0.txt)
1.21 -//
1.22 +
1.23 +// (C) Copyright 2002 Rani Sharoni (rani_sharoni@hotmail.com) and Robert Ramey
1.24 +// Use, modification and distribution is subject to the Boost Software
1.25 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1.26 +// http://www.boost.org/LICENSE_1_0.txt)
1.27 +
1.28 // See http://www.boost.org for updates, documentation, and revision history.
1.29 -//
1.30
1.31 -// Compile type discovery whether given type is abstract class or not.
1.32 -//
1.33 -// Requires DR 337 to be supported by compiler
1.34 -// (http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#337).
1.35 -//
1.36 -//
1.37 -// Believed (Jan 2004) to work on:
1.38 -// - GCC 3.4
1.39 -// - VC++ 7.1
1.40 -// - compilers with new EDG frontend (Intel C++ 7, Comeau 4.3.2)
1.41 -//
1.42 -// Doesn't work on:
1.43 -// - VC++6, VC++7.0 and less
1.44 -// - GCC 3.3.X and less
1.45 -// - Borland C++ 6 and less
1.46 -//
1.47 -//
1.48 -// History:
1.49 -// - Originally written by Rani Sharoni, see
1.50 -// http://groups.google.com/groups?selm=df893da6.0207110613.75b2fe90%40posting.google.com
1.51 -// At this time supported by EDG (Intel C++ 7, Comeau 4.3.2) and VC7.1.
1.52 -// - Adapted and added into Boost.Serialization library by Robert Ramey
1.53 -// (starting with submission #10).
1.54 -// - Jan 2004: GCC 3.4 fixed to suport DR337 (Giovanni Bajo).
1.55 -// - Jan 2004: modified to be part of Boost.TypeTraits (Pavel Vozenilek).
1.56 -// - Nov 2004: Christoph Ludwig found that the implementation did not work with
1.57 -// template types and gcc-3.4 or VC7.1, fix due to Christoph Ludwig
1.58 -// and John Maddock.
1.59 -// - Dec 2004: Added new config macro BOOST_NO_IS_ABSTRACT which causes the template
1.60 -// to degrade gracefully, rather than trash the compiler (John Maddock).
1.61 -//
1.62 -
1.63 -#include <boost/static_assert.hpp>
1.64 -#include <boost/type_traits/detail/yes_no_type.hpp>
1.65 -#include <boost/type_traits/is_class.hpp>
1.66 -#include <boost/type_traits/detail/ice_and.hpp>
1.67 -#ifdef BOOST_NO_IS_ABSTRACT
1.68 -#include <boost/type_traits/is_polymorphic.hpp>
1.69 -#endif
1.70 -// should be the last #include
1.71 -#include <boost/type_traits/detail/bool_trait_def.hpp>
1.72 -
1.73 +#include <boost/config.hpp>
1.74 +#include <boost/mpl/bool.hpp>
1.75 +#include <boost/type_traits/is_abstract.hpp>
1.76
1.77 namespace boost {
1.78 -namespace detail{
1.79 -
1.80 -#ifndef BOOST_NO_IS_ABSTRACT
1.81 -template<class T>
1.82 -struct is_abstract_imp2
1.83 -{
1.84 - // Deduction fails if T is void, function type,
1.85 - // reference type (14.8.2/2)or an abstract class type
1.86 - // according to review status issue #337
1.87 - //
1.88 - template<class U>
1.89 - static type_traits::no_type check_sig(U (*)[1]);
1.90 - template<class U>
1.91 - static type_traits::yes_type check_sig(...);
1.92 - //
1.93 - // T must be a complete type, further if T is a template then
1.94 - // it must be instantiated in order for us to get the right answer:
1.95 - //
1.96 - BOOST_STATIC_ASSERT(sizeof(T) != 0);
1.97 -
1.98 - // GCC2 won't even parse this template if we embed the computation
1.99 - // of s1 in the computation of value.
1.100 -#ifdef __GNUC__
1.101 - BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(is_abstract_imp2<T>::template check_sig<T>(0)));
1.102 -#else
1.103 - BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig<T>(0)));
1.104 -#endif
1.105 -
1.106 - BOOST_STATIC_CONSTANT(bool, value =
1.107 - (s1 == sizeof(type_traits::yes_type)));
1.108 -};
1.109 -
1.110 -template <bool v>
1.111 -struct is_abstract_select
1.112 -{
1.113 - template <class T>
1.114 - struct rebind
1.115 - {
1.116 - typedef is_abstract_imp2<T> type;
1.117 - };
1.118 -};
1.119 -template <>
1.120 -struct is_abstract_select<false>
1.121 -{
1.122 - template <class T>
1.123 - struct rebind
1.124 - {
1.125 - typedef false_type type;
1.126 - };
1.127 -};
1.128 -
1.129 -template <class T>
1.130 -struct is_abstract_imp
1.131 -{
1.132 - typedef is_abstract_select< ::boost::is_class<T>::value> selector;
1.133 - typedef typename selector::template rebind<T> binder;
1.134 - typedef typename binder::type type;
1.135 -
1.136 - BOOST_STATIC_CONSTANT(bool, value = type::value);
1.137 -};
1.138 -
1.139 -#endif
1.140 -}
1.141 -
1.142 -#ifndef BOOST_NO_IS_ABSTRACT
1.143 -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_abstract_imp<T>::value)
1.144 -#else
1.145 -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_polymorphic_imp<T>::value)
1.146 -#endif
1.147 -
1.148 +namespace serialization {
1.149 + template<class T>
1.150 + struct is_abstract {
1.151 + // default to false if not supported
1.152 + #ifdef BOOST_NO_IS_ABSTRACT
1.153 + typedef BOOST_DEDUCED_TYPENAME mpl::bool_<false> type;
1.154 + BOOST_STATIC_CONSTANT(bool, value = false);
1.155 + #else
1.156 + typedef BOOST_DEDUCED_TYPENAME boost::is_abstract<T>::type type;
1.157 + BOOST_STATIC_CONSTANT(bool, value = type::value);
1.158 + #endif
1.159 + };
1.160 +} // namespace serialization
1.161 } // namespace boost
1.162
1.163 -#include <boost/type_traits/detail/bool_trait_undef.hpp>
1.164 +// define a macro to make explicit designation of this more transparent
1.165 +#define BOOST_IS_ABSTRACT(T) \
1.166 +namespace boost { \
1.167 +namespace serialization { \
1.168 +template<> \
1.169 +struct is_abstract< T > { \
1.170 + typedef mpl::bool_<true> type; \
1.171 + BOOST_STATIC_CONSTANT(bool, value = true); \
1.172 +}; \
1.173 +} \
1.174 +} \
1.175 +/**/
1.176
1.177 -#endif //BOOST_TT_IS_ABSTRACT_CLASS_HPP
1.178 +#endif //BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP