Boost logo

Glas :

[glas] Ref counting

From: Neal Becker (ndbecker2_at_[hidden])
Date: 2007-10-12 13:29:40


Here is one example of where I see the usefulness. I have many algorithms
written in c++ that I want to expose to python. Using most other array
libraries, a slice of an array is a different object type than an array.
This means that on the python side we now have to deal with both arrays, and
array slices, and the combinatorial explosion of combinations.

If writing in strictly c++, that's not a problem because the compiler deals
with the compile time polymorphism. That's no help for mixing compile-time
with run-time.

With ref counting, there is no distinction between these concepts. All arrays
are 'views' of memory. A slice of an array is to python just another array.
That makes things much simpler.