Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:38

0001 // Copyright David Abrahams 2002.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef VOID_PTR_DWA200239_HPP
0006 # define VOID_PTR_DWA200239_HPP
0007 
0008 # include <boost/python/detail/type_traits.hpp>
0009 
0010 namespace boost { namespace python { namespace detail { 
0011 
0012 template <class U>
0013 inline U& void_ptr_to_reference(void const volatile* p, U&(*)())
0014 {
0015     return *(U*)p;
0016 }
0017 
0018 template <class T>
0019 inline void write_void_ptr(void const volatile* storage, void* ptr, T*)
0020 {
0021     *(T**)storage = (T*)ptr;
0022 }
0023 
0024 // writes U(ptr) into the storage
0025 template <class U>
0026 inline void write_void_ptr_reference(void const volatile* storage, void* ptr, U&(*)())
0027 {
0028     // stripping CV qualification suppresses warnings on older EDGs
0029     typedef typename remove_cv<U>::type u_stripped; 
0030     write_void_ptr(storage, ptr, u_stripped(0));
0031 }
0032 
0033 }}} // namespace boost::python::detail
0034 
0035 #endif // VOID_PTR_DWA200239_HPP