1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/detail/construct.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,42 @@
1.4 +// Copyright David Abrahams 2002.
1.5 +// Distributed under the Boost Software License, Version 1.0. (See
1.6 +// accompanying file LICENSE_1_0.txt or copy at
1.7 +// http://www.boost.org/LICENSE_1_0.txt)
1.8 +#ifndef CONSTRUCT_REFERENCE_DWA2002716_HPP
1.9 +# define CONSTRUCT_REFERENCE_DWA2002716_HPP
1.10 +
1.11 +namespace boost { namespace python { namespace detail {
1.12 +
1.13 +template <class T, class Arg>
1.14 +void construct_pointee(void* storage, Arg& x
1.15 +# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
1.16 + , T const volatile*
1.17 +# else
1.18 + , T const*
1.19 +# endif
1.20 + )
1.21 +{
1.22 + new (storage) T(x);
1.23 +}
1.24 +
1.25 +template <class T, class Arg>
1.26 +void construct_referent_impl(void* storage, Arg& x, T&(*)())
1.27 +{
1.28 + construct_pointee(storage, x, (T*)0);
1.29 +}
1.30 +
1.31 +template <class T, class Arg>
1.32 +void construct_referent(void* storage, Arg const& x, T(*tag)() = 0)
1.33 +{
1.34 + construct_referent_impl(storage, x, tag);
1.35 +}
1.36 +
1.37 +template <class T, class Arg>
1.38 +void construct_referent(void* storage, Arg& x, T(*tag)() = 0)
1.39 +{
1.40 + construct_referent_impl(storage, x, tag);
1.41 +}
1.42 +
1.43 +}}} // namespace boost::python::detail
1.44 +
1.45 +#endif // CONSTRUCT_REFERENCE_DWA2002716_HPP