epoc32/include/stdapis/boost/utility/enable_if.hpp
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h) This is the epoc32/include tree with the "platform" subtrees removed, and all but a selected few mbg and rsg files removed.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
// Boost enable_if library
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
// Copyright 2003 © The Trustees of Indiana University.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
// Use, modification, and distribution is subject to the Boost Software
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
// http://www.boost.org/LICENSE_1_0.txt)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
//    Authors: Jaakko Järvi (jajarvi at osl.iu.edu)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
//             Jeremiah Willcock (jewillco at osl.iu.edu)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
//             Andrew Lumsdaine (lums at osl.iu.edu)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
#ifndef BOOST_UTILITY_ENABLE_IF_HPP
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
#define BOOST_UTILITY_ENABLE_IF_HPP
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
#include "boost/config.hpp"
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
// Even the definition of enable_if causes problems on some compilers,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
// so it's macroed out for all compilers that do not support SFINAE
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
#ifndef BOOST_NO_SFINAE
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
namespace boost
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
  template <bool B, class T = void>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
  struct enable_if_c {
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
    typedef T type;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
  };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
  template <class T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
  struct enable_if_c<false, T> {};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
  template <class Cond, class T = void> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
  struct enable_if : public enable_if_c<Cond::value, T> {};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
  template <bool B, class T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
  struct lazy_enable_if_c {
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
    typedef typename T::type type;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
  };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
  template <class T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
  struct lazy_enable_if_c<false, T> {};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
  template <class Cond, class T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
  struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
  template <bool B, class T = void>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
  struct disable_if_c {
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
    typedef T type;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
  };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
  template <class T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
  struct disable_if_c<true, T> {};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
  template <class Cond, class T = void> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
  struct disable_if : public disable_if_c<Cond::value, T> {};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
  template <bool B, class T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
  struct lazy_disable_if_c {
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
    typedef typename T::type type;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
  };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
  template <class T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
  struct lazy_disable_if_c<true, T> {};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
  template <class Cond, class T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
  struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
} // namespace boost
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
#else
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
namespace boost {
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
  namespace detail { typedef void enable_if_default_T; }
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    80
  template <typename T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
  struct enable_if_does_not_work_on_this_compiler;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
  template <bool B, class T = detail::enable_if_default_T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
  struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
  { };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
  template <bool B, class T = detail::enable_if_default_T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
  struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
  { };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
  template <bool B, class T = detail::enable_if_default_T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
  struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
  { };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
  template <bool B, class T = detail::enable_if_default_T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
  struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
  { };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
  template <class Cond, class T = detail::enable_if_default_T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
  struct enable_if : enable_if_does_not_work_on_this_compiler<T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
  { };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   103
  template <class Cond, class T = detail::enable_if_default_T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
  struct disable_if : enable_if_does_not_work_on_this_compiler<T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
  { };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   106
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
  template <class Cond, class T = detail::enable_if_default_T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
  struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
  { };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
  template <class Cond, class T = detail::enable_if_default_T> 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
  struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
  { };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
} // namespace boost
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
#endif // BOOST_NO_SFINAE
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
#endif