detail/call_traits.hpp
Go to the documentation of this file.
1 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
2 // Use, modification and distribution are subject to the Boost Software License,
3 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt).
5 //
6 // See http://www.boost.org/libs/utility for most recent version including documentation.
7 
8 // call_traits: defines typedefs for function usage
9 // (see libs/utility/call_traits.htm)
10 
11 /* Release notes:
12  23rd July 2000:
13  Fixed array specialization. (JM)
14  Added Borland specific fixes for reference types
15  (issue raised by Steve Cleary).
16 */
17 
18 #ifndef BOOST_DETAIL_CALL_TRAITS_HPP
19 #define BOOST_DETAIL_CALL_TRAITS_HPP
20 
21 #ifndef BOOST_CONFIG_HPP
22 #include <boost/config.hpp>
23 #endif
24 #include <cstddef>
25 
30 
31 namespace boost{
32 
33 namespace detail{
34 
35 template <typename T, bool small_>
36 struct ct_imp2
37 {
38  typedef const T& param_type;
39 };
40 
41 template <typename T>
42 struct ct_imp2<T, true>
43 {
44  typedef const T param_type;
45 };
46 
47 template <typename T, bool isp, bool b1, bool b2>
48 struct ct_imp
49 {
50  typedef const T& param_type;
51 };
52 
53 template <typename T, bool isp, bool b2>
54 struct ct_imp<T, isp, true, b2>
55 {
56  typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
57 };
58 
59 template <typename T, bool isp, bool b1>
60 struct ct_imp<T, isp, b1, true>
61 {
62  typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
63 };
64 
65 template <typename T, bool b1, bool b2>
66 struct ct_imp<T, true, b1, b2>
67 {
68  typedef const T param_type;
69 };
70 
71 }
72 
73 template <typename T>
75 {
76 public:
77  typedef T value_type;
78  typedef T& reference;
79  typedef const T& const_reference;
80  //
81  // C++ Builder workaround: we should be able to define a compile time
82  // constant and pass that as a single template parameter to ct_imp<T,bool>,
83  // however compiler bugs prevent this - instead pass three bool's to
84  // ct_imp<T,bool,bool,bool> and add an extra partial specialisation
85  // of ct_imp to handle the logic. (JM)
86  typedef typename boost::detail::ct_imp<
87  T,
92 };
93 
94 template <typename T>
95 struct call_traits<T&>
96 {
97  typedef T& value_type;
98  typedef T& reference;
99  typedef const T& const_reference;
100  typedef T& param_type; // hh removed const
101 };
102 
103 #if BOOST_WORKAROUND( __BORLANDC__, < 0x5A0 )
104 // these are illegal specialisations; cv-qualifies applied to
105 // references have no effect according to [8.3.2p1],
106 // C++ Builder requires them though as it treats cv-qualified
107 // references as distinct types...
108 template <typename T>
109 struct call_traits<T&const>
110 {
111  typedef T& value_type;
112  typedef T& reference;
113  typedef const T& const_reference;
114  typedef T& param_type; // hh removed const
115 };
116 template <typename T>
117 struct call_traits<T&volatile>
118 {
119  typedef T& value_type;
120  typedef T& reference;
121  typedef const T& const_reference;
122  typedef T& param_type; // hh removed const
123 };
124 template <typename T>
125 struct call_traits<T&const volatile>
126 {
127  typedef T& value_type;
128  typedef T& reference;
129  typedef const T& const_reference;
130  typedef T& param_type; // hh removed const
131 };
132 
133 template <typename T>
134 struct call_traits< T * >
135 {
136  typedef T * value_type;
137  typedef T * & reference;
138  typedef T * const & const_reference;
139  typedef T * const param_type; // hh removed const
140 };
141 #endif
142 #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
143 template <typename T, std::size_t N>
144 struct call_traits<T [N]>
145 {
146 private:
147  typedef T array_type[N];
148 public:
149  // degrades array to pointer:
150  typedef const T* value_type;
151  typedef array_type& reference;
152  typedef const array_type& const_reference;
153  typedef const T* const param_type;
154 };
155 
156 template <typename T, std::size_t N>
157 struct call_traits<const T [N]>
158 {
159 private:
160  typedef const T array_type[N];
161 public:
162  // degrades array to pointer:
163  typedef const T* value_type;
164  typedef array_type& reference;
165  typedef const array_type& const_reference;
166  typedef const T* const param_type;
167 };
168 #endif
169 
170 }
171 
172 #endif // BOOST_DETAIL_CALL_TRAITS_HPP
boost::call_traits< T[N]>::const_reference
const typedef array_type & const_reference
Definition: detail/call_traits.hpp:152
boost::call_traits::const_reference
const typedef T & const_reference
Definition: detail/call_traits.hpp:79
config.hpp
boost::call_traits< T[N]>::reference
array_type & reference
Definition: detail/call_traits.hpp:151
boost::call_traits< T & >::reference
T & reference
Definition: detail/call_traits.hpp:98
boost::call_traits< const T[N]>::reference
array_type & reference
Definition: detail/call_traits.hpp:164
boost::detail::ct_imp< T, true, b1, b2 >::param_type
const typedef T param_type
Definition: detail/call_traits.hpp:68
detail
detail namespace with internal helper functions
Definition: json.hpp:269
boost::call_traits< const T[N]>::param_type
const typedef T *const param_type
Definition: detail/call_traits.hpp:166
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
Definition: core/addressof.hpp:19
boost::call_traits< T[N]>::param_type
const typedef T *const param_type
Definition: detail/call_traits.hpp:153
boost::call_traits< const T[N]>::const_reference
const typedef array_type & const_reference
Definition: detail/call_traits.hpp:165
boost::detail::ct_imp
Definition: detail/call_traits.hpp:48
is_pointer.hpp
boost::call_traits< T[N]>::value_type
const typedef T * value_type
Definition: detail/call_traits.hpp:150
value
GLfloat value
Definition: glad/glad/glad.h:2099
boost::call_traits< T & >::param_type
T & param_type
Definition: detail/call_traits.hpp:100
boost::detail::ct_imp2< T, true >::param_type
const typedef T param_type
Definition: detail/call_traits.hpp:44
is_enum.hpp
boost::detail::ct_imp2
Definition: detail/call_traits.hpp:36
t265_stereo.T
T
Definition: t265_stereo.py:157
boost::detail::ct_imp::param_type
const typedef T & param_type
Definition: detail/call_traits.hpp:50
boost::call_traits::param_type
boost::detail::ct_imp< T, ::std::is_pointer< T >::value, ::std::is_arithmetic< T >::value, ::std::is_enum< T >::value >::param_type param_type
Definition: detail/call_traits.hpp:91
is_arithmetic.hpp
boost::call_traits< const T[N]>::value_type
const typedef T * value_type
Definition: detail/call_traits.hpp:163
boost::call_traits::reference
T & reference
Definition: detail/call_traits.hpp:78
boost::detail::ct_imp2::param_type
const typedef T & param_type
Definition: detail/call_traits.hpp:38
boost::call_traits::value_type
T value_type
Definition: detail/call_traits.hpp:77
boost::call_traits< T & >::const_reference
const typedef T & const_reference
Definition: detail/call_traits.hpp:99
boost::call_traits
Definition: detail/call_traits.hpp:74
boost::call_traits< T & >::value_type
T & value_type
Definition: detail/call_traits.hpp:97
workaround.hpp


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Thu Dec 22 2022 03:13:14