Re: Overriding __concat behavior
Ryan Pavlik <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
__concat would be a method in the metatable, not in the table itself, so I think that would keep your current approach from working. My hunch is that you'd need to look at the header for luabind::tostring and do something similar for concat. If you do, fork Luabind on GitHub so that the improvement can be re-integrated. On Tue, Mar 22, 2011 at 11:20 PM, Teto <[email protected]> wrote: > Hi there, > > I'm doing everything I can to ease lua side debugging and for this purpose, > I need to override __tostring and __concat from C++. > > I've succeeded in overriding tostring (followed the manual + looked on the > ml to see that if it didn't work with luabind::self, I could use const_self, > maybe that tip could go to the online tutorial) > .def( luabind::tostring(luabind::const_self) ) > > For __concat, I do that with a wrong prototype I guess ( std::string > CStaticBattery::concat() ): > .def( "__concat",&CStaticBattery::concat ) > > Would the prototype : std::string CStaticBattery::concat(const std::string > & str1,const std::string& str2 ) work ? > What would be str1 and str2 ? Left and right ? like in print( > str1..myBatteryConcat..str2) ? > > I will appreciate any example. > > > Thx > > > ------------------------------------------------------------------------------ > Enable your software for Intel(R) Active Management Technology to meet the > growing manageability and security demands of your customers. Businesses > are taking advantage of Intel(R) vPro (TM) technology - will your software > be a part of the solution? Download the Intel(R) Manageability Checker > today! http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > luabind-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/luabind-user > > -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University [email protected] http://academic.cleardefinition.com Internal VRAC/HCI Site: http://tinyurl.com/rpavlik ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user