os/ossrv/ossrv_pub/boost_apis/boost/python/detail/construct.hpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright David Abrahams 2002.
sl@0
     2
// Distributed under the Boost Software License, Version 1.0. (See
sl@0
     3
// accompanying file LICENSE_1_0.txt or copy at
sl@0
     4
// http://www.boost.org/LICENSE_1_0.txt)
sl@0
     5
#ifndef CONSTRUCT_REFERENCE_DWA2002716_HPP
sl@0
     6
# define CONSTRUCT_REFERENCE_DWA2002716_HPP
sl@0
     7
sl@0
     8
namespace boost { namespace python { namespace detail { 
sl@0
     9
sl@0
    10
template <class T, class Arg>
sl@0
    11
void construct_pointee(void* storage, Arg& x
sl@0
    12
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
sl@0
    13
                       , T const volatile*
sl@0
    14
# else 
sl@0
    15
                       , T const*
sl@0
    16
# endif 
sl@0
    17
    )
sl@0
    18
{
sl@0
    19
    new (storage) T(x);
sl@0
    20
}
sl@0
    21
sl@0
    22
template <class T, class Arg>
sl@0
    23
void construct_referent_impl(void* storage, Arg& x, T&(*)())
sl@0
    24
{
sl@0
    25
    construct_pointee(storage, x, (T*)0);
sl@0
    26
}
sl@0
    27
sl@0
    28
template <class T, class Arg>
sl@0
    29
void construct_referent(void* storage, Arg const& x, T(*tag)() = 0)
sl@0
    30
{
sl@0
    31
    construct_referent_impl(storage, x, tag);
sl@0
    32
}
sl@0
    33
sl@0
    34
template <class T, class Arg>
sl@0
    35
void construct_referent(void* storage, Arg& x, T(*tag)() = 0)
sl@0
    36
{
sl@0
    37
    construct_referent_impl(storage, x, tag);
sl@0
    38
}
sl@0
    39
sl@0
    40
}}} // namespace boost::python::detail
sl@0
    41
sl@0
    42
#endif // CONSTRUCT_REFERENCE_DWA2002716_HPP