<br><br><div class="gmail_quote">2011/6/15 Andi Clemens <span dir="ltr"><<a href="mailto:andi.clemens@gmx.net">andi.clemens@gmx.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Right, we are still using too many raw pointers.<br>
Qt, C++ stdlib and boost have many things to handle pointers automatically.<br></blockquote><div><br></div><div>Yes. this one is exactly that we need :</div><div><br></div><div><a href="http://doc.qt.nokia.com/4.7/qpointer.html">http://doc.qt.nokia.com/4.7/qpointer.html</a> </div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
See Item #13 in "Effective C++": Use objects to manage resources<br>
A great book, everyone should read it...<br>
<br></blockquote><div><br></div><div>Do you have an url ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Anyway sure auto_ptr and friends will "slow" down execution, but with all<br>
the checks we do anyway, I guess it will not be noticeable.<br>
It is still much faster than garbage collection...<br>
<br></blockquote><div><br></div><div>Perhaps we will need to patch code about to use QPointer everywhere when it's necessary...</div><div><br></div><div>Gilles </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


Andi<br>
<br>
<br>
On Wed, 15 Jun 2011 11:55:50 +0200, Marcel Wiesweg <<a href="mailto:marcel.wiesweg@gmx.de">marcel.wiesweg@gmx.de</a>><br>
wrote:<br>
<br>
><br>
<div class="im">>> a few months ago, maybe 2 years.<br>
>> I know that I always added<br>
>> xyz = 0;<br>
>> to my code before, but then it was removed again because it is not<br>
>> neccessary with modern compilers (I don't know who said that).<br>
><br>
> When googling and reading through the usual sources (stackoverflow etc.)<br>
> I see noone saying that any compiler sets a pointer to 0, I would even<br>
> guess delete should _not_ change the value of the passed pointer unless<br>
> the C++ standard says so.<br>
> There are the usual stories not to use raw pointers and use concepts to<br>
> make sure you are always sure never to use deleted pointers again, but<br>
> in the end, if you are playing with raw pointers (which we are doing<br>
> still in too many areas IMO, but getting less) and need to delete and<br>
> reuse the variable, be sure to set it to 0.<br>
><br>
> Marcel<br>
<br>
<br>
--<br>
</div><div class="im">Using Opera's revolutionary email client: <a href="http://www.opera.com/mail/" target="_blank">http://www.opera.com/mail/</a><br>
_______________________________________________<br>
</div><div><div></div><div class="h5">Digikam-devel mailing list<br>
<a href="mailto:Digikam-devel@kde.org">Digikam-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/digikam-devel" target="_blank">https://mail.kde.org/mailman/listinfo/digikam-devel</a><br>
</div></div></blockquote></div><br>