comparison DEPENDENCIES/generic/include/boost/aligned_storage.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
46 { 46 {
47 union data_t 47 union data_t
48 { 48 {
49 char buf[size_]; 49 char buf[size_];
50 50
51 typename mpl::eval_if_c< 51 typename ::boost::mpl::eval_if_c<
52 alignment_ == std::size_t(-1) 52 alignment_ == std::size_t(-1)
53 , mpl::identity<detail::max_align> 53 , ::boost::mpl::identity< ::boost::detail::max_align >
54 , type_with_alignment<alignment_> 54 , ::boost::type_with_alignment<alignment_>
55 >::type align_; 55 >::type align_;
56 } data_; 56 } data_;
57 void* address() const { return const_cast<aligned_storage_imp*>(this); } 57 void* address() const { return const_cast<aligned_storage_imp*>(this); }
58 }; 58 };
59 59
74 #ifndef __BORLANDC__ 74 #ifndef __BORLANDC__
75 private 75 private
76 #else 76 #else
77 public 77 public
78 #endif 78 #endif
79 detail::aligned_storage::aligned_storage_imp<size_, alignment_> 79 ::boost::detail::aligned_storage::aligned_storage_imp<size_, alignment_>
80 { 80 {
81 81
82 public: // constants 82 public: // constants
83 83
84 typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type; 84 typedef ::boost::detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
85 85
86 BOOST_STATIC_CONSTANT( 86 BOOST_STATIC_CONSTANT(
87 std::size_t 87 std::size_t
88 , size = size_ 88 , size = size_
89 ); 89 );
94 ? ::boost::detail::aligned_storage::alignment_of_max_align 94 ? ::boost::detail::aligned_storage::alignment_of_max_align
95 : alignment_ 95 : alignment_
96 ) 96 )
97 ); 97 );
98 98
99 #if defined(__GNUC__) &&\
100 (__GNUC__ > 3) ||\
101 (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\
102 (__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3)))
103
104 private: // noncopyable 99 private: // noncopyable
105 100
106 aligned_storage(const aligned_storage&); 101 aligned_storage(const aligned_storage&);
107 aligned_storage& operator=(const aligned_storage&); 102 aligned_storage& operator=(const aligned_storage&);
108
109 #else // gcc less than 3.2.3
110
111 public: // _should_ be noncopyable, but GCC compiler emits error
112
113 aligned_storage(const aligned_storage&);
114 aligned_storage& operator=(const aligned_storage&);
115
116 #endif // gcc < 3.2.3 workaround
117 103
118 public: // structors 104 public: // structors
119 105
120 aligned_storage() 106 aligned_storage()
121 { 107 {
130 void* address() 116 void* address()
131 { 117 {
132 return static_cast<type*>(this)->address(); 118 return static_cast<type*>(this)->address();
133 } 119 }
134 120
135 #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
136
137 const void* address() const 121 const void* address() const
138 { 122 {
139 return static_cast<const type*>(this)->address(); 123 return static_cast<const type*>(this)->address();
140 } 124 }
141
142 #else // MSVC6
143
144 const void* address() const;
145
146 #endif // MSVC6 workaround
147
148 }; 125 };
149 126
150 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
151
152 // MSVC6 seems not to like inline functions with const void* returns, so we
153 // declare the following here:
154
155 template <std::size_t S, std::size_t A>
156 const void* aligned_storage<S,A>::address() const
157 {
158 return const_cast< aligned_storage<S,A>* >(this)->address();
159 }
160
161 #endif // MSVC6 workaround
162
163 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
164 // 127 //
165 // Make sure that is_pod recognises aligned_storage<>::type 128 // Make sure that is_pod recognises aligned_storage<>::type
166 // as a POD (Note that aligned_storage<> itself is not a POD): 129 // as a POD (Note that aligned_storage<> itself is not a POD):
167 // 130 //
168 template <std::size_t size_, std::size_t alignment_> 131 template <std::size_t size_, std::size_t alignment_>
169 struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> > 132 struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
170 BOOST_TT_AUX_BOOL_C_BASE(true) 133 BOOST_TT_AUX_BOOL_C_BASE(true)
171 { 134 {
172 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) 135 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
173 }; 136 };
174 #endif
175 137
176 138
177 } // namespace boost 139 } // namespace boost
178 140
179 #include "boost/type_traits/detail/bool_trait_undef.hpp" 141 #include "boost/type_traits/detail/bool_trait_undef.hpp"