[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] C++ teoretisk spørgsmål vedr. auto_ptr



Mark Wrobel wrote:
Morten Sylvest Olsen wrote:

Ja, det har jeg set beskrevet på www.gotw.ca tror jeg. Det hænger sammen med assignment opratoren ikke kun giver en kopi men også flytter ejerskab. Hvis man vil sortere en stl container med auto_ptr's i (det kunne man engang) så ville en sorterings algoritmes interne pivot element flytte ejerskab og derved efterlade auto_ptr med deletede pointers.

Præcist. Det er nu mere enkelt end det. Ved indsætning / udtagning fra STL container bliver elementet (som regel) kopieret, så allerede der vil du have tabt.


Takker for henvisningerne :-). Dem vil jeg straks kaste mig over! Alle Boost bibliotekerne fylder dog en del. Hvad er stilen, skal man bare downloade det hele, eller tager man kun en del og inkluderer. Her tænker jeg specielt hvis man i fremtiden skal bundle det med sin kode.

Det kan vist best betale sig at hente det hele, så har man det. Det meste af "magien" i boost ligger i templates, så det er måske ikke engang nødvendigt at distribuere biblioteker fx. hvis man bare bruged shared_ptr etc.


Mvh Morten

 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *