epoc32/include/stdapis/boost/utility/enable_if.hpp
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/utility/enable_if.hpp	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,119 @@
     1.4 +// Boost enable_if library
     1.5 +
     1.6 +// Copyright 2003 © The Trustees of Indiana University.
     1.7 +
     1.8 +// Use, modification, and distribution is subject to the Boost Software
     1.9 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.10 +// http://www.boost.org/LICENSE_1_0.txt)
    1.11 +
    1.12 +//    Authors: Jaakko Järvi (jajarvi at osl.iu.edu)
    1.13 +//             Jeremiah Willcock (jewillco at osl.iu.edu)
    1.14 +//             Andrew Lumsdaine (lums at osl.iu.edu)
    1.15 +
    1.16 +
    1.17 +#ifndef BOOST_UTILITY_ENABLE_IF_HPP
    1.18 +#define BOOST_UTILITY_ENABLE_IF_HPP
    1.19 +
    1.20 +#include "boost/config.hpp"
    1.21 +
    1.22 +// Even the definition of enable_if causes problems on some compilers,
    1.23 +// so it's macroed out for all compilers that do not support SFINAE
    1.24 +
    1.25 +#ifndef BOOST_NO_SFINAE
    1.26 +
    1.27 +namespace boost
    1.28 +{
    1.29 + 
    1.30 +  template <bool B, class T = void>
    1.31 +  struct enable_if_c {
    1.32 +    typedef T type;
    1.33 +  };
    1.34 +
    1.35 +  template <class T>
    1.36 +  struct enable_if_c<false, T> {};
    1.37 +
    1.38 +  template <class Cond, class T = void> 
    1.39 +  struct enable_if : public enable_if_c<Cond::value, T> {};
    1.40 +
    1.41 +  template <bool B, class T>
    1.42 +  struct lazy_enable_if_c {
    1.43 +    typedef typename T::type type;
    1.44 +  };
    1.45 +
    1.46 +  template <class T>
    1.47 +  struct lazy_enable_if_c<false, T> {};
    1.48 +
    1.49 +  template <class Cond, class T> 
    1.50 +  struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
    1.51 +
    1.52 +
    1.53 +  template <bool B, class T = void>
    1.54 +  struct disable_if_c {
    1.55 +    typedef T type;
    1.56 +  };
    1.57 +
    1.58 +  template <class T>
    1.59 +  struct disable_if_c<true, T> {};
    1.60 +
    1.61 +  template <class Cond, class T = void> 
    1.62 +  struct disable_if : public disable_if_c<Cond::value, T> {};
    1.63 +
    1.64 +  template <bool B, class T>
    1.65 +  struct lazy_disable_if_c {
    1.66 +    typedef typename T::type type;
    1.67 +  };
    1.68 +
    1.69 +  template <class T>
    1.70 +  struct lazy_disable_if_c<true, T> {};
    1.71 +
    1.72 +  template <class Cond, class T> 
    1.73 +  struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
    1.74 +
    1.75 +} // namespace boost
    1.76 +
    1.77 +#else
    1.78 +
    1.79 +namespace boost {
    1.80 +
    1.81 +  namespace detail { typedef void enable_if_default_T; }
    1.82 +
    1.83 +  template <typename T>
    1.84 +  struct enable_if_does_not_work_on_this_compiler;
    1.85 +
    1.86 +  template <bool B, class T = detail::enable_if_default_T>
    1.87 +  struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
    1.88 +  { };
    1.89 +
    1.90 +  template <bool B, class T = detail::enable_if_default_T> 
    1.91 +  struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
    1.92 +  { };
    1.93 +
    1.94 +  template <bool B, class T = detail::enable_if_default_T> 
    1.95 +  struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
    1.96 +  { };
    1.97 +
    1.98 +  template <bool B, class T = detail::enable_if_default_T> 
    1.99 +  struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
   1.100 +  { };
   1.101 +
   1.102 +  template <class Cond, class T = detail::enable_if_default_T> 
   1.103 +  struct enable_if : enable_if_does_not_work_on_this_compiler<T>
   1.104 +  { };
   1.105 +
   1.106 +  template <class Cond, class T = detail::enable_if_default_T> 
   1.107 +  struct disable_if : enable_if_does_not_work_on_this_compiler<T>
   1.108 +  { };
   1.109 +
   1.110 +  template <class Cond, class T = detail::enable_if_default_T> 
   1.111 +  struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
   1.112 +  { };
   1.113 +
   1.114 +  template <class Cond, class T = detail::enable_if_default_T> 
   1.115 +  struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
   1.116 +  { };
   1.117 +
   1.118 +} // namespace boost
   1.119 +
   1.120 +#endif // BOOST_NO_SFINAE
   1.121 +
   1.122 +#endif