Last change
on this file since 29 was
29,
checked in by landauf, 16 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
813 bytes
|
Rev | Line | |
---|
[29] | 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 | |
---|
| 6 | #include <boost/python/module.hpp> |
---|
| 7 | #include <boost/python/def.hpp> |
---|
| 8 | #include <boost/python/class.hpp> |
---|
| 9 | #include <boost/python/implicit.hpp> |
---|
| 10 | #include <boost/mpl/list.hpp> |
---|
| 11 | |
---|
| 12 | struct Type1 {}; |
---|
| 13 | |
---|
| 14 | struct Term {Term(Type1 const&) {} }; |
---|
| 15 | |
---|
| 16 | struct Expression {void add(Term const&) {} }; |
---|
| 17 | |
---|
| 18 | BOOST_PYTHON_MODULE(bienstman4_ext) |
---|
| 19 | { |
---|
| 20 | using namespace boost::python; |
---|
| 21 | using boost::mpl::list; |
---|
| 22 | |
---|
| 23 | implicitly_convertible<Type1,Term>(); |
---|
| 24 | |
---|
| 25 | class_<Expression>("Expression") |
---|
| 26 | .def("add", &Expression::add) |
---|
| 27 | ; |
---|
| 28 | |
---|
| 29 | class_<Type1>("T1") |
---|
| 30 | ; |
---|
| 31 | |
---|
| 32 | class_<Term>("Term", init<Type1&>()) |
---|
| 33 | ; |
---|
| 34 | |
---|
| 35 | Type1 t1; |
---|
| 36 | Expression e; |
---|
| 37 | e.add(t1); |
---|
| 38 | } |
---|
| 39 | |
---|
Note: See
TracBrowser
for help on using the repository browser.