2
0
mirror of https://github.com/boostorg/python.git synced 2026-02-02 21:12:15 +00:00

Take advantage of independent class_<> definitions everywhere.

[SVN r14976]
This commit is contained in:
Dave Abrahams
2002-08-19 22:21:03 +00:00
parent 3092e07281
commit 1a7b331a4b
15 changed files with 141 additions and 205 deletions

View File

@@ -48,40 +48,21 @@ public:
};
BOOST_PYTHON_MODULE_INIT(cltree) {
boost::python::module m("cltree");
m
.add(
boost::python::class_<basic>("basic")
.def_init(boost::python::args<>())
BOOST_PYTHON_MODULE_INIT(cltree)
{
boost::python::class_<basic>("basic")
.def("__repr__",&basic::repr)
)
;
;
m
.add(boost::python::class_<constant
,boost::python::bases<basic>
,boost::noncopyable
>("constant")
.def_init(boost::python::args<>())
)
boost::python::class_<constant, boost::python::bases<basic>, boost::noncopyable>("constant")
;
.add(boost::python::class_<symbol
,symbol_wrapper
,boost::noncopyable
>("symbol")
.def_init(boost::python::args<>())
)
.add(boost::python::class_<variable
,boost::python::bases<basic>
,variable_wrapper
//,boost::noncopyable // leads to compiler failure?!
>("variable")
.def_init(boost::python::args<>())
)
;
boost::python::class_<symbol, symbol_wrapper, boost::noncopyable>("symbol")
;
boost::python::class_<variable, boost::python::bases<basic>, variable_wrapper>("variable")
;
}
#include "module_tail.cpp"