[C++-sig] lvalue converter - pass by reference (non-const)

Hans Meine meine at informatik.uni-hamburg.de
Thu May 15 11:53:49 CEST 2008


Am Mittwoch, 14. Mai 2008 22:55:25 schrieb Moe Goldberg:
> and then try to run it as follows:
>  >>> import custom_string
>  >>> mystr="123"
>  >>> custom_string.size(mystr)
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> Boost.Python.ArgumentError: Python argument types in
>     custom_string.size(str)
> did not match C++ signature:
>     size(sandbox::(anonymous namespace)::custom_string {lvalue})

You're not passing a custom_string, but a python str-object (which is 
furthermore immutable).  How should the BPL extract a reference to a 
custom_string from a str-object?

-- 
Ciao, /  /
     /--/
    /  / ANS



More information about the Cplusplus-sig mailing list