[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: toLua++ question
- From: Tim Mensch <tim-lua-l@...>
- Date: Tue, 14 Dec 2010 21:02:07 -0700
On 12/13/2010 1:19 PM, Tim Mensch wrote:
> On 12/11/2010 2:42 PM, Anders Backman wrote:
>> I would have to say, no. Not without some additional work.
>> I have a modified tolua++ which supports our reference counting.
>> I had to add a few macros:
> And as far as that goes, it DOES look to me that toLua++ would support
> at least the reference counted part, since it supports returning objects
> by value, and you could tell it (as I said in my example) that the
> shared_ptr<> "derived" from the class itself. It holds an object as a
> pointer, but if it's a pointer to an allocated shared_ptr<>, then that
> should work correctly, yes? Though maybe not; object.foo() in Lua might
> try to dispatch to (*object).foo() instead of object->foo()
The result of the experiment is that, yes, toLua++ does handle boost
smart pointers when set up as I described above, with exactly the
shortcoming (not being able to call the base class with a derived
pointer) that I described.