Boost logo

Boost :

From: Jacek Generowicz (jmg_at_[hidden])
Date: 2001-07-13 03:14:05


Maybe a naive question, but I've not had much luck in finding the
answer in the documentation.

Suppose I am creating a python module based around a C++ class.

  class foo { . . . };
  ...
  class_builder<foo> foo_class( the_module, "foo" );

How should I go about exposing functions which return objects of type
foo?

  foo bar(...) { foo f; ...; return f; }

Are there any complications when foo is a template class ?

(My attempts compile, but when the module is imported in python an
error message like

 ImportError: ./foo.so: undefined symbol: __pl__FRCt6foo1ZdT0

appears. If foo-returning functions are avoided, everything seems to
work as it should.)

Thanks,

Jacek


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk