No builtin support for std::string& in return values.
Bug #1286490 reported by
Kevin Stenerson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyBindGen |
Fix Committed
|
Low
|
Unassigned |
Bug Description
There exists support for string references as parameters, but there is no built-in support for string references as return values.
Note, in this particular case I'm mostly concerned with a type like "const std::string&".
Just for reference, in case I'm doing something completely silly, here is the end of the error output received when using retval('const std::string &')
File "/usr/lib64/
raise TypeLookupError
pybindgen.
Changed in pybindgen: | |
status: | Confirmed → Fix Committed |
To post a comment you must log in.
This is because it is simply not possible to return a reference to a temporary variable, at least in "reverse wrappers". Adding support for returning references is really hard. I suggest you just use std::string instead of std::string& as type. It will probably work just as well as long as you are not using it in a virtual method or attribute.