[C++-sig] How can I make myself usefull?

Jim Bosch talljimbo at gmail.com
Sun May 13 00:48:09 CEST 2012


On 05/08/2012 02:14 AM, Matthew Scouten wrote:
> Hello,
> 	I have recently been laid off from a job where a made a lot of good
> use of Boost.Python. I would like to give something back (while incidentally
> keeping my skills from getting rusty). I have already been following the
> boost-python tag on stackoverflow and answering a lot of question there
> (http://stackoverflow.com/users/8508/matthew-scouten). I haven't hacked on
> the internals of BP much, but now that I have time.
>
> While I was there, I had some code (now lost to me) that made BP easier to
> use.
> Here is some of that I had:
>
> * A deepcopyable suite, so that any c++ class with an appropriate copy ctor
> could be quickly given a __deepcopy__, a __copy__ and a copying __init__,
> with a single line.
>
> * A similar compare suite, so that classes with == and<  could be given a
> full set of comparison operators, with a single line
>
> * 2 function templates, SafePointer2Object and SafeObject2Pointer which
> dealt with conversions between bp::objects that might be None and  pointers
> to c++ classes that might be NULL
>
> * Simple RAII objects that dealt with acquiring and freeing the GIL around
> callbacks on different threads. A similar one for freeing the GIL around a
> code block. An idea that maybe this could be a call policy.
>
> * No_compare_indexing_suite is vector_indexing_suite for classes without ==
>
> I would like to recreate some of these up for inclusion in BP, if you are
> interested. Or if there is other work that needs doing....

All of these sound very useful, and I'd love to see any of them in 
Boost.Python (well, to be honest, I don't use threading much, so I don't 
have much need for the GIL tools, but I know others on this list seem to 
be GIL-wrangling all the time).

Another thing to consider is C++11 support, and particularly support for 
the C++11 standard library.  I don't know think any of the original 
library builders or maintainers has any plans to devote any of their own 
time to add support for e.g. std::tuple or even std::shared_ptr and 
unique_ptr, but that's going to be increasingly important as C++11 
compiler support gets better.  Being able to wrap C++ functions that 
take rvalue reference arguments would be another important C++11 feature 
to support, but possibly a lot harder.

Thanks!

Jim


More information about the Cplusplus-sig mailing list