1 // Copyright David Abrahams 2002.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef VOID_PTR_DWA200239_HPP
6 # define VOID_PTR_DWA200239_HPP
8 # include <boost/type_traits/remove_cv.hpp>
10 namespace boost { namespace python { namespace detail {
13 inline U& void_ptr_to_reference(void const volatile* p, U&(*)())
19 inline void write_void_ptr(void const volatile* storage, void* ptr, T*)
21 *(T**)storage = (T*)ptr;
24 // writes U(ptr) into the storage
26 inline void write_void_ptr_reference(void const volatile* storage, void* ptr, U&(*)())
28 // stripping CV qualification suppresses warnings on older EDGs
29 typedef typename remove_cv<U>::type u_stripped;
30 write_void_ptr(storage, ptr, u_stripped(0));
33 }}} // namespace boost::python::detail
35 #endif // VOID_PTR_DWA200239_HPP