[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] Smarte pointere i C++



On Mon, Oct 11, 2004 at 10:59:09AM +0200, Lars Riisgaard Ribe wrote:
> Hej prog'ere
> Jeg har skrevet et C++-bibliotek til behandling af data, jeg sidder med 
> på arbejde, men pga. størrelserne af disse, bliver mere eller mindre 
> alle data sendt som pointere. Jeg er dog ved at miste overblikket over, 
> hvor de forskellige data skal nedlægges igen, så for at undgå memory 
> leaks/referere en pointer til data der er væk, ville jeg høre, om nogle 
> af jer har erfaringer med smarte pointere? Og evt. har et link til 
> noget, jeg kan kode op mod?

Der findes auto_ptr i STL. Desuden har Boost en managed (reference
counted) pointer der kan en del mere.

Men, som oftest kan man da løse de her problemer ved at være 100%
afklaret med hvem der har ansvar for allokering og de-allokering, og så
gennemføre den politik igennem hele sin kode - men det vidste du sikkert
i forvejen   ;)

-- 

 / jakob



 
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] *