ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-Porters
perl6-Porters
Re: Simplfied vector<> ?
by Jean-Louis Leroy other posts by this author
Apr 30 2000 9:45AM messages near this date
Re: Better mousetrap ^W Makefile | Re: Simplfied vector<> ?
>  The standard C++ vector<> container is almost perfect for use in Perl
 >  arrays and the data stack.  But it has a major weakness...  It's _so_
 >  general that it doesn't use memcpy() [or moral equivalent] when it has
 >  to grow.  Instead, it uses copy constructors in a loop.  That could be
 >  a major performance issue with vector<Counted_p<T>>.
 
 Have you considered deque<> ? It doesn't copy the elements when
 growing.
 
 >  Now, I could write a vector<>
 
 Do you mean a vector_Counted_p<> ? Better create a partial
 specialization of vector<> :
 
         template<class T, class A> 
         class vector<Counted_p<T> , A>
         {
                 // ...
         };
 -- 
 Jean-Louis Leroy
 http://users.skynet.be/jll
Thread:
Jean-Louis Leroy
Chip Salzenberg

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved