On Mon, Apr 11, 2005 at 08:34:56PM +0100 Nick Ing-Simmons wrote: > Tassilo von Parseval <[EMAIL PROTECTED]> writes: > >On Wed, Feb 23, 2005 at 09:37:01PM +0100 Tommy Nordgren wrote: > >> I wan't to find recommendations on a suitable book about writing > >> External Perl Modules > >> In particular, I wan't to know how to do this in C++, with a lot of > >> static/global variables containing dynamically allocated memory > >> (std::map, std::vector, etc.) > > > >Your first step should be figuring out how to do it in plain C. You can > >then make the transition to C++ which is fairly smooth from an XS > >point-of-view. > > > >A few weeks ago I wrapped parts of std::vector into an XS class just to > >see whether there are any significant differences from using C. It > >turned out that the C++/XS combo is very convenient and offers some nice > >shortcuts. I still have these preliminary experiments lying around and > >could post or send them off-list. > > We could do with updating (and making easier to find) the various > tips and tricks of C++/xs.
Which would imply that there is actually an amount of C++/XS tricks available in a variety of places. The only two I know of is perlxs.pod whose information on that matter are fairly puny, and - of course - existing XS modules written in C++ on the CPAN. Anything I did with it so far was a result of trial-and-error procedures. Are there any good ideas around how to remedy those deficiencies? Tassilo -- use bigint; $n=71423350343770280161397026330337371139054411854220053437565440; $m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);