Boost logo

Boost :

From: John Barnard (barnard_at_[hidden])
Date: 2000-12-12 16:05:59


Ullrich sent me a reply, so my original message must have gotten
through. Ullrich's reply combined with a missing const declaration
cured my problem.

It may be helpful in the virtual function segment of the BPL
documentation to modify the pure virtual function example to

(1) include a constructor def for baz_class, i.e., add the line


to the initfoobar definition

(2) add a constructor to baz_callback, i.e., add the line

baz_callback(PyObject* self) : m_self(self) {}

to the definition of baz_callback

Because I was wrapping a pure abstract class, I assumed that the
wrapper class (e.g., baz_class) shouldn't have a constructor. I
believe the example will still compile without (1) (but not without
(2)), but you won't be able to subclass baz in Python and use
instances of such a subclass in C++ (which is what
my problem was about).


John Barnard
Assistant Professor
Department of Statistics
Harvard University
Phone: (617) 495-1603
Fax:   (617) 496-8057
Email: barnard_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at