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

Revision 857, 911 bytes checked in by igarcia, 19 years ago (diff)
RevLine 
[857]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 IMPLICIT_DWA2002325_HPP
6# define IMPLICIT_DWA2002325_HPP
7
8# include <boost/python/detail/prefix.hpp>
9# include <boost/type.hpp>
10# include <boost/python/converter/implicit.hpp>
11# include <boost/python/converter/registry.hpp>
12# include <boost/python/type_id.hpp>
13
14namespace boost { namespace python {
15
16template <class Source, class Target>
17void implicitly_convertible(boost::type<Source>* = 0, boost::type<Target>* = 0)
18{
19    typedef converter::implicit<Source,Target> functions;
20   
21    converter::registry::push_back(
22          &functions::convertible
23        , &functions::construct
24        , type_id<Target>());
25}
26
27}} // namespace boost::python
28
29#endif // IMPLICIT_DWA2002325_HPP
Note: See TracBrowser for help on using the repository browser.