Re: Support for "adopt" to use a custom smart pointer, patch included

Daniel Wallin <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
On Tue, Jun 22, 2010 at 07:00:27PM -0700, Ben Wilhelm wrote:
> 
> I recently found I needed to combine the "custom smart pointer"
> feature for class creation, along with "adopt" for picking up the
> return value from a function. I couldn't find any way to do this
> with the current codebase so I implemented a new adopt function
> named adopt_container. I'm attaching a patch for it - it hasn't yet
> been extensively tested, but it seems to work.
> 
> Let me know if there are any problems with it, or any better way to
> write it. I'd appreciate it if this functionality could make it into
> luabind-0.10 whenever it shows up, one way or another, even if the
> actual code behind it is different. :)

Thank you. Excellent idea. I commited a slightly cleaned up patch, using
an overload of adopt() for both cases and giving the capability to
adopt_pointer rather than adding a new converter:

  http://github.com/luabind/luabind/commit/ed8cc7fbaff9e6ce

-- 
Daniel Wallin
BoostPro Computing
http://www.boostpro.com

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.