1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef VOID_PTR_DWA200239_HPP
- # define VOID_PTR_DWA200239_HPP
- # include <boost/python/detail/type_traits.hpp>
- namespace boost { namespace python { namespace detail {
- template <class U>
- inline U& void_ptr_to_reference(void const volatile* p, U&(*)())
- {
- return *(U*)p;
- }
- template <class T>
- inline void write_void_ptr(void const volatile* storage, void* ptr, T*)
- {
- *(T**)storage = (T*)ptr;
- }
- template <class U>
- inline void write_void_ptr_reference(void const volatile* storage, void* ptr, U&(*)())
- {
-
- typedef typename remove_cv<U>::type u_stripped;
- write_void_ptr(storage, ptr, u_stripped(0));
- }
- }}}
- #endif
|