mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 18:12:43 +00:00
fix bugs in example code
[SVN r31305]
This commit is contained in:
@@ -121,13 +121,14 @@ scope();
|
||||
|
||||
<p>C++ Module definition:</p>
|
||||
<pre>
|
||||
#include <boost/python/module.hpp>
|
||||
#include <boost/python/class.hpp>
|
||||
#include <boost/python/scope.hpp>
|
||||
using namespace boost::python;
|
||||
|
||||
struct X
|
||||
{
|
||||
void f();
|
||||
void f() {}
|
||||
|
||||
struct Y { int g() { return 42; } };
|
||||
};
|
||||
@@ -145,8 +146,8 @@ BOOST_PYTHON_MODULE(nested)
|
||||
;
|
||||
|
||||
// Define a class Y in the current scope, X
|
||||
class_<Y>("Y")
|
||||
.def("g", &Y::g)
|
||||
class_<X::Y>("Y")
|
||||
.def("g", &X::Y::g)
|
||||
;
|
||||
}
|
||||
</pre>
|
||||
|
||||
Reference in New Issue
Block a user