From: Marcelo M. <mm...@ac...> - 2006-04-16 15:51:56
|
You can derive from std:map, just be sure you use %template before it, ie %template(mapi) std::map<std::string,int>; class A : public std::map<std::string,int> { }; Marcelo Daniel Moore wrote: >On 4/15/06, Nitro <ni...@dr...> wrote: > =20 > >>See also: http://comments.gmane.org/gmane.comp.programming.swig/3824 >>Maybe you can get it to work with swig, but as for me I am nowadays >>convinced that you shouldn't derive from std::string (i guess the same >>holds for map). >> =20 >> > >I think in general, I agree. In this case, we have a special class >that is-a std::map and doesn't extend or modify it at all. So it could >really be a typedef. It _isn't_ a typedef so it can be used in forward >declarations easily or some-such. > >Anyway, having looked at std_map and scrounged around on the web etc, >I think my question _should_ be... how can we access std::map or >classes _like_ std::map so they look like perl hashes? > >(I gather that FIRSTKEY & NEXTKEY went away recently... anyone have >further info on what's happening in that department?) > >cheers. > >-- >----------------------------------------------------- >Daniel Moore > > >------------------------------------------------------- >This SF.Net email is sponsored by xPML, a groundbreaking scripting langu= age >that extends applications into web and mobile media. Attend the live web= cast >and join the prime developer group breaking into this new coding territo= ry! >http://sel.as-us.falkag.net/sel?cmd=FFk&kid=110944&bid$1720&dat=121642 >_______________________________________________ >Swig-user mailing list >Swi...@li... >https://lists.sourceforge.net/lists/listinfo/swig-user > > =20 > |