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