2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 06:02:14 +00:00

Remove Boost.Python v1 from main trunk

[SVN r15723]
This commit is contained in:
Dave Abrahams
2002-10-05 04:37:49 +00:00
parent 8207dc756a
commit 30d9331079
106 changed files with 88 additions and 20334 deletions

View File

@@ -9,22 +9,15 @@ namespace { // Avoid cluttering the global namespace.
int square(int number) { return number * number; }
}
#include <boost/python/class_builder.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
namespace python = boost::python;
// Python requires an exported function called init<module-name> in every
// extension module. This is where we build the module contents.
BOOST_PYTHON_MODULE_INIT(getting_started1)
BOOST_PYTHON_MODULE(getting_started1)
{
try {
// Create an object representing this extension module.
python::module_builder this_module("getting_started1");
// Add regular functions to the module.
this_module.def(greet, "greet");
this_module.def(square, "square");
}
catch(...) {
boost::python::handle_exception();
}
python::def("greet", greet);
python::def("square", square);
}