sl@0: // Copyright David Abrahams 2002. sl@0: // Distributed under the Boost Software License, Version 1.0. (See sl@0: // accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: #ifndef CONSTRUCT_REFERENCE_DWA2002716_HPP sl@0: # define CONSTRUCT_REFERENCE_DWA2002716_HPP sl@0: sl@0: namespace boost { namespace python { namespace detail { sl@0: sl@0: template sl@0: void construct_pointee(void* storage, Arg& x sl@0: # if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 sl@0: , T const volatile* sl@0: # else sl@0: , T const* sl@0: # endif sl@0: ) sl@0: { sl@0: new (storage) T(x); sl@0: } sl@0: sl@0: template sl@0: void construct_referent_impl(void* storage, Arg& x, T&(*)()) sl@0: { sl@0: construct_pointee(storage, x, (T*)0); sl@0: } sl@0: sl@0: template sl@0: void construct_referent(void* storage, Arg const& x, T(*tag)() = 0) sl@0: { sl@0: construct_referent_impl(storage, x, tag); sl@0: } sl@0: sl@0: template sl@0: void construct_referent(void* storage, Arg& x, T(*tag)() = 0) sl@0: { sl@0: construct_referent_impl(storage, x, tag); sl@0: } sl@0: sl@0: }}} // namespace boost::python::detail sl@0: sl@0: #endif // CONSTRUCT_REFERENCE_DWA2002716_HPP