1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/graph/detail/is_same.hpp Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,103 @@
1.4 +
1.5 +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
1.6 +// Howard Hinnant and John Maddock 2000.
1.7 +// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
1.8 +
1.9 +// Use, modification and distribution are subject to the Boost Software License,
1.10 +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1.11 +// http://www.boost.org/LICENSE_1_0.txt).
1.12 +//
1.13 +// See http://www.boost.org/libs/type_traits for most recent version including documentation.
1.14 +
1.15 +// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
1.16 +// is_member_pointer based on the Simulated Partial Specialization work
1.17 +// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
1.18 +// http://groups.yahoo.com/group/boost/message/5441
1.19 +// Some workarounds in here use ideas suggested from "Generic<Programming>:
1.20 +// Mappings between Types and Values"
1.21 +// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
1.22 +
1.23 +
1.24 +#ifndef BOOST_TT_IS_SAME_HPP_INCLUDED
1.25 +#define BOOST_TT_IS_SAME_HPP_INCLUDED
1.26 +
1.27 +#include <boost/type_traits/config.hpp>
1.28 +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1.29 +#include <boost/type_traits/detail/yes_no_type.hpp>
1.30 +#include <boost/type_traits/detail/ice_and.hpp>
1.31 +#include <boost/type_traits/is_reference.hpp>
1.32 +#endif
1.33 +// should be the last #include
1.34 +#include <boost/type_traits/detail/bool_trait_def.hpp>
1.35 +
1.36 +namespace boost {
1.37 +
1.38 +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1.39 +
1.40 +BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,false)
1.41 +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T,T,true)
1.42 +#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
1.43 +// without this, Borland's compiler gives the wrong answer for
1.44 +// references to arrays:
1.45 +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T&,T&,true)
1.46 +#endif
1.47 +
1.48 +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1.49 +
1.50 +namespace detail {
1.51 +
1.52 +#ifdef BOOST_MSVC
1.53 +// the following VC6 specific implementation is *NOT* legal
1.54 +// C++, but has the advantage that it works for incomplete
1.55 +// types.
1.56 +
1.57 +template< typename T1 >
1.58 +struct is_same_part_1
1.59 +{
1.60 + template<typename T2> struct part_2 { enum { value = false }; };
1.61 + template<> struct part_2<T1> { enum { value = true }; };
1.62 +};
1.63 +
1.64 +template< typename T1, typename T2 >
1.65 +struct is_same_impl
1.66 +{
1.67 + enum { value = detail::is_same_part_1<T1>::template part_2<T2>::value };
1.68 +};
1.69 +
1.70 +#else // generic "no-partial-specialization" version
1.71 +
1.72 +template <typename T>
1.73 +::boost::type_traits::yes_type
1.74 +BOOST_TT_DECL is_same_tester(T*, T*);
1.75 +
1.76 +::boost::type_traits::no_type
1.77 +BOOST_TT_DECL is_same_tester(...);
1.78 +
1.79 +template <typename T, typename U>
1.80 +struct is_same_impl
1.81 +{
1.82 + static T t;
1.83 + static U u;
1.84 +
1.85 + BOOST_STATIC_CONSTANT(bool, value =
1.86 + (::boost::type_traits::ice_and<
1.87 + (sizeof(type_traits::yes_type) == sizeof(detail::is_same_tester(&t,&u))),
1.88 + (::boost::is_reference<T>::value == ::boost::is_reference<U>::value),
1.89 + (sizeof(T) == sizeof(U))
1.90 + >::value));
1.91 +};
1.92 +
1.93 +#endif // BOOST_MSVC
1.94 +
1.95 +} // namespace detail
1.96 +
1.97 +BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,(::boost::detail::is_same_impl<T,U>::value))
1.98 +
1.99 +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1.100 +
1.101 +} // namespace boost
1.102 +
1.103 +#include <boost/type_traits/detail/bool_trait_undef.hpp>
1.104 +
1.105 +#endif // BOOST_TT_IS_SAME_HPP_INCLUDED
1.106 +