epoc32/include/stdapis/boost/graph/detail/is_same.hpp
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/boost/graph/detail/is_same.hpp	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/boost/graph/detail/is_same.hpp	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,103 +1,40 @@
     1.4 +//=======================================================================
     1.5 +// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
     1.6 +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
     1.7 +//
     1.8 +// Distributed under the Boost Software License, Version 1.0. (See
     1.9 +// accompanying file LICENSE_1_0.txt or copy at
    1.10 +// http://www.boost.org/LICENSE_1_0.txt)
    1.11 +//=======================================================================
    1.12 +#ifndef BOOST_GRAPH_DETAIL_IS_SAME_HPP
    1.13 +#define BOOST_GRAPH_DETAIL_IS_SAME_HPP
    1.14  
    1.15 -//  (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, 
    1.16 -//      Howard Hinnant and John Maddock 2000. 
    1.17 -//  (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
    1.18 -
    1.19 -//  Use, modification and distribution are subject to the Boost Software License,
    1.20 -//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.21 -//  http://www.boost.org/LICENSE_1_0.txt).
    1.22 -//
    1.23 -//  See http://www.boost.org/libs/type_traits for most recent version including documentation.
    1.24 -
    1.25 -//    Fixed is_pointer, is_reference, is_const, is_volatile, is_same, 
    1.26 -//    is_member_pointer based on the Simulated Partial Specialization work 
    1.27 -//    of Mat Marcus and Jesse Jones. See  http://opensource.adobe.com or 
    1.28 -//    http://groups.yahoo.com/group/boost/message/5441 
    1.29 -//    Some workarounds in here use ideas suggested from "Generic<Programming>: 
    1.30 -//    Mappings between Types and Values" 
    1.31 -//    by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
    1.32 -
    1.33 -
    1.34 -#ifndef BOOST_TT_IS_SAME_HPP_INCLUDED
    1.35 -#define BOOST_TT_IS_SAME_HPP_INCLUDED
    1.36 -
    1.37 -#include <boost/type_traits/config.hpp>
    1.38 -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    1.39 -#include <boost/type_traits/detail/yes_no_type.hpp>
    1.40 -#include <boost/type_traits/detail/ice_and.hpp>
    1.41 -#include <boost/type_traits/is_reference.hpp>
    1.42 -#endif
    1.43 -// should be the last #include
    1.44 -#include <boost/type_traits/detail/bool_trait_def.hpp>
    1.45 +#include <boost/pending/ct_if.hpp>
    1.46  
    1.47  namespace boost {
    1.48 +  struct false_tag;
    1.49 +  struct true_tag;
    1.50  
    1.51 -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    1.52 -
    1.53 -BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,false)
    1.54 -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T,T,true)
    1.55 -#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
    1.56 -// without this, Borland's compiler gives the wrong answer for
    1.57 -// references to arrays:
    1.58 -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T&,T&,true)
    1.59 +  namespace graph_detail {
    1.60 +    
    1.61 +#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    1.62 +    template <class U, class V>
    1.63 +    struct is_same {
    1.64 +      typedef boost::false_tag is_same_tag; 
    1.65 +    };
    1.66 +    template <class U>
    1.67 +    struct is_same<U, U> {
    1.68 +      typedef boost::true_tag is_same_tag;
    1.69 +    };
    1.70 +#else
    1.71 +    template <class U, class V>
    1.72 +    struct is_same {
    1.73 +      enum { Unum = U::num, Vnum = V::num };
    1.74 +      typedef typename boost::ct_if< (Unum == Vnum),
    1.75 +               boost::true_tag, boost::false_tag>::type is_same_tag;
    1.76 +    };
    1.77  #endif
    1.78 -
    1.79 -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    1.80 -
    1.81 -namespace detail {
    1.82 -
    1.83 -#ifdef BOOST_MSVC
    1.84 -// the following VC6 specific implementation is *NOT* legal
    1.85 -// C++, but has the advantage that it works for incomplete
    1.86 -// types.
    1.87 -
    1.88 -template< typename T1 >
    1.89 -struct is_same_part_1
    1.90 -{
    1.91 -    template<typename T2>  struct part_2     { enum { value = false }; };
    1.92 -    template<>             struct part_2<T1> { enum { value = true }; };
    1.93 -};
    1.94 -
    1.95 -template< typename T1, typename T2 >
    1.96 -struct is_same_impl
    1.97 -{
    1.98 -    enum { value = detail::is_same_part_1<T1>::template part_2<T2>::value };
    1.99 -};
   1.100 -
   1.101 -#else // generic "no-partial-specialization" version
   1.102 -
   1.103 -template <typename T>
   1.104 -::boost::type_traits::yes_type
   1.105 -BOOST_TT_DECL is_same_tester(T*, T*);
   1.106 -
   1.107 -::boost::type_traits::no_type
   1.108 -BOOST_TT_DECL is_same_tester(...);
   1.109 -
   1.110 -template <typename T, typename U>
   1.111 -struct is_same_impl
   1.112 -{
   1.113 -   static T t;
   1.114 -   static U u;
   1.115 -
   1.116 -   BOOST_STATIC_CONSTANT(bool, value =
   1.117 -      (::boost::type_traits::ice_and<
   1.118 -         (sizeof(type_traits::yes_type) == sizeof(detail::is_same_tester(&t,&u))),
   1.119 -         (::boost::is_reference<T>::value == ::boost::is_reference<U>::value),
   1.120 -         (sizeof(T) == sizeof(U))
   1.121 -        >::value));
   1.122 -};
   1.123 -
   1.124 -#endif // BOOST_MSVC
   1.125 -
   1.126 -} // namespace detail
   1.127 -
   1.128 -BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,(::boost::detail::is_same_impl<T,U>::value))
   1.129 -
   1.130 -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
   1.131 -
   1.132 +  } // namespace graph_detail
   1.133  } // namespace boost
   1.134  
   1.135 -#include <boost/type_traits/detail/bool_trait_undef.hpp>
   1.136 -
   1.137 -#endif  // BOOST_TT_IS_SAME_HPP_INCLUDED
   1.138 -
   1.139 +#endif