composite_pointer_type.hpp
Go to the documentation of this file.
1 #ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED
2 #define BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED
3 
4 //
5 // Copyright 2015 Peter Dimov
6 //
7 // Distributed under the Boost Software License, Version 1.0.
8 // See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt
10 //
11 
17 #include <boost/config.hpp>
18 #include <cstddef>
19 
20 namespace boost
21 {
22 
23 namespace type_traits_detail
24 {
25 
26 template<class T, class U> struct composite_pointer_type;
27 
28 // same type
29 
30 template<class T> struct composite_pointer_type<T*, T*>
31 {
32  typedef T* type;
33 };
34 
35 // nullptr_t
36 
37 #if !defined( BOOST_NO_CXX11_NULLPTR )
38 
39 #if !defined( BOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) )
40 
41 template<class T> struct composite_pointer_type<T*, decltype(nullptr)>
42 {
43  typedef T* type;
44 };
45 
46 template<class T> struct composite_pointer_type<decltype(nullptr), T*>
47 {
48  typedef T* type;
49 };
50 
51 template<> struct composite_pointer_type<decltype(nullptr), decltype(nullptr)>
52 {
53  typedef decltype(nullptr) type;
54 };
55 
56 #else
57 
58 template<class T> struct composite_pointer_type<T*, std::nullptr_t>
59 {
60  typedef T* type;
61 };
62 
63 template<class T> struct composite_pointer_type<std::nullptr_t, T*>
64 {
65  typedef T* type;
66 };
67 
68 template<> struct composite_pointer_type<std::nullptr_t, std::nullptr_t>
69 {
70  typedef std::nullptr_t type;
71 };
72 
73 #endif
74 
75 #endif // !defined( BOOST_NO_CXX11_NULLPTR )
76 
77 namespace detail
78 {
79 
80 template<class T, class U> struct has_common_pointee
81 {
82 private:
83 
84  typedef typename boost::remove_cv<T>::type T2;
85  typedef typename boost::remove_cv<U>::type U2;
86 
87 public:
88 
95 };
96 
97 template<class T, class U> struct common_pointee
98 {
99 private:
100 
101  typedef typename boost::remove_cv<T>::type T2;
102  typedef typename boost::remove_cv<U>::type U2;
103 
104 public:
105 
106  typedef typename boost::conditional<
107 
111 
113 };
114 
115 template<class T, class U> struct composite_pointer_impl
116 {
117 private:
118 
119  typedef typename boost::remove_cv<T>::type T2;
120  typedef typename boost::remove_cv<U>::type U2;
121 
122 public:
123 
125 };
126 
127 //Old compilers like MSVC-7.1 have problems using boost::conditional in
128 //composite_pointer_type. Partially specializing on has_common_pointee<T, U>::value
129 //seems to make their life easier
132  : common_pointee<T, U>
133 {};
134 
135 template<class T, class U>
137  : composite_pointer_impl<T, U>
138 {};
139 
140 
141 } // detail
142 
143 
144 template<class T, class U> struct composite_pointer_type<T*, U*>
145 {
147 };
148 
149 } // namespace type_traits_detail
150 
151 } // namespace boost
152 
153 #endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
detail::composite_pointer_type_dispatch< T, U >::type * type
GLfloat value
boost::copy_cv< typename boost::copy_cv< typename composite_pointer_type< T2, U2 >::type const, T >::type, U >::type type
const char * detail
boost::conditional< boost::is_same< T2, U2 >::value||boost::is_void< T2 >::value||boost::is_base_of< T2, U2 >::value, typename boost::copy_cv< T, U >::type, typename boost::copy_cv< U, T >::type >::type type
GLenum type
#define BOOST_STATIC_CONSTANT(type, assignment)
Definition: suffix.hpp:394


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:12