source: NonGTP/Boost/boost/python/copy_non_const_reference.hpp @ 857

Revision 857, 1.2 KB checked in by igarcia, 18 years ago (diff)
Line 
1// Copyright David Abrahams 2002.
2// Distributed under the Boost Software License, Version 1.0. (See
3// accompanying file LICENSE_1_0.txt or copy at
4// http://www.boost.org/LICENSE_1_0.txt)
5#ifndef COPY_NON_CONST_REFERENCE_DWA2002131_HPP
6# define COPY_NON_CONST_REFERENCE_DWA2002131_HPP
7
8# include <boost/python/detail/prefix.hpp>
9# include <boost/python/detail/indirect_traits.hpp>
10# include <boost/mpl/if.hpp>
11# include <boost/python/to_python_value.hpp>
12
13namespace boost { namespace python {
14
15namespace detail
16{
17  template <class R>
18  struct copy_non_const_reference_expects_a_non_const_reference_return_type
19# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__)
20  {}
21# endif
22  ;
23}
24
25template <class T> struct to_python_value;
26
27struct copy_non_const_reference
28{
29    template <class T>
30    struct apply
31    {
32        typedef typename mpl::if_c<
33            indirect_traits::is_reference_to_non_const<T>::value
34            , to_python_value<T>
35            , detail::copy_non_const_reference_expects_a_non_const_reference_return_type<T>
36        >::type type;
37    };
38};
39
40
41}} // namespace boost::python
42
43#endif // COPY_NON_CONST_REFERENCE_DWA2002131_HPP
Note: See TracBrowser for help on using the repository browser.