Dag Sverre Seljebotn, 07.07.2010 08:49:
> Robert Bradshaw wrote:
>> The primary goal with C++ support is to provide just enough C++isms to
>> easily use any of the many C++ libraries out there, but not so much
>> that the user can easily hang themselves. The goal is not to
>> facilitate writing C++ in Cython, but rather using C++ from Cython
>> (though the two overlap quite a bit on the technical plane). If we
>> want to disallow, say, references in function arguments, now is the
>> time to do so. Is there any reason this is necessary to allow?
>>
> I don't think anything of this has been on writing C++, just about
> talking to C++ libraries.
>
> The reason to allow references in function arguments in "cdef extern"
> C++ functions is that, well, libraries do come with such constructs, and
> it is not clear how one would communicate with them if references in
> function arguments isn't supported somehow. They can be used either as
> out arguments, or for passing around some global context, etc.
With my limited knowledge of C++, I don't see a problem here. After all,
Cython ignores the exact values stored in those references, and as longs as
you can't pass a ref-counted Python object as a C++ reference, it doesn't
have to know anything about them.
This will not work, though:
function_taking_a_reference(<PyObject*>some_object)
but it should not be too hard to catch by the compiler, in case it's
currently valid.
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev