[C++-sig] Wrapping pointer types in BPL 2

David Abrahams david.abrahams at rcn.com
Tue May 28 01:36:08 CEST 2002

From: "Stefan Franke" <franke at ableton.com>

> Dear David,
> I have a library some colleagues wrote that I'd like to expose to
> Python. It uses some kind of pre-GC refcounting/smart pointer
> scheme for almost all classes; later on weak pointers were added,
> but there's a lot of code before the weak-ptr era that uses plain
> pointers and relies on their validity.
> My question: Does BPL 2.0 allow me to wrap classes that are accessed
> by a mixture of plain, smart and weak pointers? Can I define the
> necessary conversion policies myself where needed?

In principle, yes. The facilities of v2 are much richer than those of v1 in
this regard, and it's designed to be a framework so you can add customized
behaviors. However, the precise answer will surely depend on exactly what
you need and expect of the library.


More information about the Cplusplus-sig mailing list