[C++-sig] boost.python automatic policies

Roman Yakovenko roman.yakovenko at gmail.com
Mon Jun 26 11:20:01 CEST 2006


On 6/26/06, Damien Gleizes <gleizesd at gmail.com> wrote:
> Hello,
>
> I am currently using boost.Python for binding C++ code. In fact, I'am parsing a
> sort of container wich stores all classes I need to bind, including their
> methods and members (methods signatures, arguments types). While parsing these
> classes, I generates CPP files containing the binding code (wich uses
> boost.Python). The problem I'am confronted to concerns the use of policies. Is
> there a way to know wich policies to use without knowing what the function
> exactly do? Without policies the code does not compile, so I wonder if it is
> possible to know wich policies to use just with the decoration of arguments and
> return value (types, reference, pointer, const etc).

The short answer is no. The long answer is here:
http://www.boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies

You can describe, what your function is doing, so it will be possible to suggest
best call policies

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list