type_traits/is_empty.hpp
Go to the documentation of this file.
1 
2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
6 //
7 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
8 
9 #ifndef BOOST_TT_IS_EMPTY_HPP_INCLUDED
10 #define BOOST_TT_IS_EMPTY_HPP_INCLUDED
11 
15 
19 
20 #ifndef BOOST_INTERNAL_IS_EMPTY
21 #define BOOST_INTERNAL_IS_EMPTY(T) false
22 #else
23 #define BOOST_INTERNAL_IS_EMPTY(T) BOOST_IS_EMPTY(T)
24 #endif
25 
26 namespace boost {
27 
28 namespace detail {
29 
30 
31 #ifdef BOOST_MSVC
32 #pragma warning(push)
33 #pragma warning(disable:4624) // destructor could not be generated
34 #endif
35 
36 template <typename T>
37 struct empty_helper_t1 : public T
38 {
39  empty_helper_t1(); // hh compiler bug workaround
40  int i[256];
41 private:
42  // suppress compiler warnings:
45 };
46 
47 #ifdef BOOST_MSVC
48 #pragma warning(pop)
49 #endif
50 
51 struct empty_helper_t2 { int i[256]; };
52 
53 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
54 
55 template <typename T, bool is_a_class = false>
57 {
58  BOOST_STATIC_CONSTANT(bool, value = false);
59 };
60 
61 template <typename T>
62 struct empty_helper<T, true>
63 {
65  bool, value = (sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2))
66  );
67 };
68 
69 template <typename T>
71 {
72  typedef typename remove_cv<T>::type cvt;
74  bool,
76 };
77 
78 #else // __BORLANDC__
79 
80 template <typename T, bool is_a_class, bool convertible_to_int>
81 struct empty_helper
82 {
83  BOOST_STATIC_CONSTANT(bool, value = false);
84 };
85 
86 template <typename T>
87 struct empty_helper<T, true, false>
88 {
90  sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2)
91  ));
92 };
93 
94 template <typename T>
95 struct is_empty_impl
96 {
97  typedef typename remove_cv<T>::type cvt;
98  typedef typename add_reference<T>::type r_type;
99 
101  bool, value = (
103  cvt
106  >::value || BOOST_INTERNAL_IS_EMPTY(cvt));
107 };
108 
109 #endif // __BORLANDC__
110 
111 } // namespace detail
112 
113 template <class T> struct is_empty : integral_constant<bool, ::boost::detail::is_empty_impl<T>::value> {};
114 
115 } // namespace boost
116 
117 #undef BOOST_INTERNAL_IS_EMPTY
118 
119 #endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED
120 
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
GLfloat value
empty_helper_t1 & operator=(const empty_helper_t1 &)
const char * detail
#define BOOST_INTERNAL_IS_EMPTY(T)
#define BOOST_STATIC_CONSTANT(type, assignment)
Definition: suffix.hpp:394
boost::detail::add_reference_impl< T >::type type


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