2006/1/23, André Wöbbeking <<a href="mailto:Woebbeking@onlinehome.de">Woebbeking@onlinehome.de</a>>:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Monday 23 January 2006 19:37, Michel Hermier wrote:<br>> Hi,<br>> I just commited the explicit constructor patch for KSharedPtr.<br><br>Thanks, it was really time for that :-)</blockquote><div><br>Hehe ;)<br><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> There are less than 10 files to adapt.<br>> So please maintainers adapt the remaining files the why you like.
<br><br>I did, and some usages of KSharedPtr looks a bit scary, i.e.<br>KSharedConfig::openConfig().</blockquote><div><br>This one is not really scary. It's a cache of raw pointer and there are no other way of doing it.<br>
If the config hash use shared pointer, the shared config will be in the cache *forever*.<br>It's not scary to manipulate raw pointer of shared pointer inside of it's factory.<br>It's way more scary to use raw pointer outside of it's factory.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Shouldn't KSharedPtr<T>& operator= ( T* p ) be also removed?</blockquote>
<div><br>I also thougth so at first, but I really think it should be here since it's as dangenrous as calling the operator= with a fresh KSharedPtr. Plus the fact that the class mimic the QSharedDataPointer API.<br>I would say it's safer to call attach() since you should really know what you are doing with it, and we can grep for it just in case.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">BTW, did you think about my suggestion to use the boost API (i.e.<br>attach() vs. reset(), data() vs. get(), ...)?
</blockquote><div><br>I don't really have an opinion about that. It's a religion talk. I think we must at least follow the Qt naming convention first. Maybe we can also add some helper method to be compatible with the boost convention, but I don't really care since these are one liners.
<br><br>cheers,<br> Michel<br><br>Next steps for KSharedPtr:<br>- manually deinling clear and detach (isUnique?) for speed (in debug mode).<br>- adding swap method to speed up shared ptr swap ? (using qSwap here may be to much slow?)
<br> (thx to andré for *making* me looking at the boost documentation :)<br><br></div></div>