core/enable_if.hpp
Go to the documentation of this file.
1 // Boost enable_if library
2 
3 // Copyright 2003 (c) The Trustees of Indiana University.
4 
5 // Use, modification, and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 
9 // Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
10 // Jeremiah Willcock (jewillco at osl.iu.edu)
11 // Andrew Lumsdaine (lums at osl.iu.edu)
12 
13 
14 #ifndef BOOST_CORE_ENABLE_IF_HPP
15 #define BOOST_CORE_ENABLE_IF_HPP
16 
17 #include "boost/config.hpp"
18 
19 // Even the definition of enable_if causes problems on some compilers,
20 // so it's macroed out for all compilers that do not support SFINAE
21 
22 #ifndef BOOST_NO_SFINAE
23 
24 namespace boost
25 {
26  template<typename T, typename R=void>
28  {
29  typedef R type;
30  };
31 
32  template <bool B, class T = void>
33  struct enable_if_c {
34  typedef T type;
35  };
36 
37  template <class T>
38  struct enable_if_c<false, T> {};
39 
40  template <class Cond, class T = void>
41  struct enable_if : public enable_if_c<Cond::value, T> {};
42 
43  template <bool B, class T>
45  typedef typename T::type type;
46  };
47 
48  template <class T>
49  struct lazy_enable_if_c<false, T> {};
50 
51  template <class Cond, class T>
52  struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
53 
54 
55  template <bool B, class T = void>
56  struct disable_if_c {
57  typedef T type;
58  };
59 
60  template <class T>
61  struct disable_if_c<true, T> {};
62 
63  template <class Cond, class T = void>
64  struct disable_if : public disable_if_c<Cond::value, T> {};
65 
66  template <bool B, class T>
68  typedef typename T::type type;
69  };
70 
71  template <class T>
72  struct lazy_disable_if_c<true, T> {};
73 
74  template <class Cond, class T>
75  struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
76 
77 } // namespace boost
78 
79 #else
80 
81 namespace boost {
82 
83  namespace detail { typedef void enable_if_default_T; }
84 
85  template <typename T>
86  struct enable_if_does_not_work_on_this_compiler;
87 
88  template<typename T, typename R=void>
89  struct enable_if_has_type : enable_if_does_not_work_on_this_compiler<T>
90  { };
91 
92  template <bool B, class T = detail::enable_if_default_T>
93  struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
94  { };
95 
96  template <bool B, class T = detail::enable_if_default_T>
97  struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
98  { };
99 
100  template <bool B, class T = detail::enable_if_default_T>
101  struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
102  { };
103 
104  template <bool B, class T = detail::enable_if_default_T>
105  struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
106  { };
107 
108  template <class Cond, class T = detail::enable_if_default_T>
109  struct enable_if : enable_if_does_not_work_on_this_compiler<T>
110  { };
111 
112  template <class Cond, class T = detail::enable_if_default_T>
113  struct disable_if : enable_if_does_not_work_on_this_compiler<T>
114  { };
115 
116  template <class Cond, class T = detail::enable_if_default_T>
117  struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
118  { };
119 
120  template <class Cond, class T = detail::enable_if_default_T>
121  struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
122  { };
123 
124 } // namespace boost
125 
126 #endif // BOOST_NO_SFINAE
127 
128 #endif
boost::enable_if_c
Definition: core/enable_if.hpp:33
boost::disable_if_c
Definition: core/enable_if.hpp:56
R
#define R(x, n)
Definition: SHA256.cpp:50
T
T
Definition: mem_fn_cc.hpp:25
config.hpp
boost::lazy_enable_if_c
Definition: core/enable_if.hpp:44
boost::enable_if_has_type::type
R type
Definition: core/enable_if.hpp:29
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::enable_if_has_type
Definition: core/enable_if.hpp:27
boost::lazy_enable_if
Definition: core/enable_if.hpp:52
boost::lazy_disable_if_c
Definition: core/enable_if.hpp:67
boost::disable_if
Definition: core/enable_if.hpp:64
boost::lazy_disable_if
Definition: core/enable_if.hpp:75
boost::enable_if
Definition: core/enable_if.hpp:41
boost::lazy_disable_if_c::type
T::type type
Definition: core/enable_if.hpp:68
boost::disable_if_c::type
T type
Definition: core/enable_if.hpp:57
boost::enable_if_c::type
T type
Definition: core/enable_if.hpp:34
boost::lazy_enable_if_c::type
T::type type
Definition: core/enable_if.hpp:45


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:38:54