<div class="gmail_quote">On 5 July 2012 13:10, Joel Uckelman <span dir="ltr"><<a href="mailto:uckelman@nomic.net" target="_blank">uckelman@nomic.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Do you know why Boost Python complains about returning a char const*?<br></blockquote><div><br>When returning a pointer, you have to tell Boost::Python what to do with it. The most important issue is one of ownership. Once the pointer has been returned as a Python object in the Python world, and that object goes out of scope, what should happen with the pointer? Is it owned by Python and should the pointed-to memory be deallocated too? Or was it still owned by the function that returned it? This is what you have to tell Boost::Python before it allows you to return pointers. And this is also why I looked for a solution that didn't involve pointers - much easier to understand as a first example.<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
It's a strange thing to have for the first example in the docs if it
won't compile.</blockquote></div><br>I agree. Personally I can't do anything about that, though.<br clear="all"><br>-- <br>Sybren A. Stüvel<br><br><a href="http://stuvel.eu/" target="_blank">http://stuvel.eu/</a><br>
<br><br>