Re: Overloads w/shared_ptr
eduard mueller <[email protected]> Wed, 17 Aug 2011 11:30:28 +0200
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <CAMCDzW3kvgjkJcSE8MJ-3bAzEN6wqKJ8cRGcD+zdyrMj3+097w@mail.gmail.com> |
A wild quick guess: Try passing a [const] reference instead. void wrapped_do_something(const FoobarPtr& object) or void wrapped_do_something(FoobarPtr& object) Also remember the ugly colon in Lua (I personally just can't get used to it): obj:do_something() or obj.do_something(obj) On Wed, Aug 17, 2011 at 10:20, Stefan Schindler <[email protected]> wrote: > Hi guys, > > I'm currently having a problem with specifying a custom overload for the > following definition: > > typedef boost::shared_ptr<Foobar> FoobarPtr; > > void wrapped_do_something( FoobarPtr object ) { > ... > } > > class_<Foobar, FoobarPtr>( "Foobar" ) > .def( "do_something", &wrapped_do_something ) > ; > > Compiles fine, however when calling 'do_something' from Lua, it > complains about not finding a matching overload. The first parameter is > named "custom [N5boost10shared_ptrIN6FoobarEEE]" in the error message. > > My assumption is that at the time 'wrapped_do_something' is defined with > '.def', it's not known that 'Foobar' objects are being held by > 'FoobarPtr'. However I don't have an idea how to solve it. > > Greetings, > Stefan. > > > ------------------------------------------------------------------------------ > Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > user administration capabilities and model configuration. Take > the hassle out of deploying and managing Subversion and the > tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > _______________________________________________ > luabind-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/luabind-user > ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user