diff --git a/overriding.html b/overriding.html
index 82cb442d..ecf7efb7 100644
--- a/overriding.html
+++ b/overriding.html
@@ -50,8 +50,8 @@ struct world_callback : hello::world
// Something Python can call in case there is no override of get()
- const char* default_get() const
- { return this->hello::world::get(); }
+ const char* default_get(hello::world* self) const
+ { return self->hello::world::get(); }
private:
PyObject* m_self; // A way to hold onto the Python object
};
@@ -97,7 +97,8 @@ world_class.def(&hello::world::get, "get", &world_callback::default_get)
inside of hello::world." One of the goals of py_cpp is to be
minimally intrusive on an existing C++ design. In principle, it should be
possible to expose the interface for a 3rd party library without changing
- it.
+ it. To unintrusively hook into the virtual functions so that a Python
+ override may be called, we must use a derived class.
Prev: A Simple Example Using py_cpp Next: A Peek Under the Hood Up: Function Overloading Up: Top
© Copyright David Abrahams 2000. Permission to copy, use, modify, @@ -171,5 +172,5 @@ AttributeError: pure express or implied warranty, and with no claim as to its suitability for any purpose.
- Updated: Sept 30, 2000 + Updated: Oct 30, 2000