[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KSharedPtr changes
From:       Michel Hermier <michel.hermier () gmail ! com>
Date:       2006-01-16 20:13:30
Message-ID: 2e631f490601161213kc8304am () mail ! gmail ! com
[Download RAW message or body]

Hi,
I just commited the first patch (the part without explicit constructor).

It seems I have a quite good feed back, for making the shared pointer
constructor explicit.
To add a little more to arguments, TT also made the QSharedDataPointer
constructor explicit, so there must be good reasons to do so ;)
So if someone as a real stopper reason to don't make the constructor
explicit, say it before the next snapshot (should be on monday next week).
After the snapshoot I'll commit only the simple pointer convertions
(implicit cast from null, and broken constructor) of my patch. I will let
methods changes left to their maintainers (implicit cast of pointer
returning).

To explicit it, I will left conversion of:
QShared<Foo> bar() {
   Foo *foo = new Foo();
   return foo;
}

Because it can be converted as:
QShared<Foo> bar() {
   QShared<Foo> foo(new Foo());
   return foo;
}

or
QShared<Foo> bar() {
   Foo *foo = new Foo();
   return QShared<Foo>(foo);
}

So I let make the final decision to the maintainers.

Cheers,
    Michel

[Attachment #3 (text/html)]

Hi,<br>I just commited the first patch (the part without explicit \
constructor).<br><br>It seems I have a quite good feed back, for making the shared \
pointer constructor explicit.<br>To add a little more to arguments, TT also made the \
QSharedDataPointer constructor explicit, so there must be good reasons to do so ;) \
<br>So if someone as a real stopper reason to don't make the constructor explicit, \
say it before the next snapshot (should be on monday next week). After the snapshoot \
I'll commit only the simple pointer convertions (implicit cast from null, and broken \
constructor) of my patch.  I will let methods changes left to their maintainers \
(implicit cast of pointer returning). <br><br>To explicit it, I will left conversion \
of:<br> QShared&lt;Foo&gt; bar() {<br>
&nbsp;&nbsp; Foo *foo = new Foo();<br>
&nbsp;&nbsp; return foo;<br>
}<br>
<br>
Because it can be converted as:<br>
QShared&lt;Foo&gt; bar() {<br>

&nbsp;&nbsp; QShared&lt;Foo&gt; foo(new Foo());<br>

&nbsp;&nbsp; return foo;<br>

}<br>

<br>
or<br>
QShared&lt;Foo&gt; bar() {<br>

&nbsp;&nbsp; Foo *foo = new Foo();<br>

&nbsp;&nbsp; return QShared&lt;Foo&gt;(foo);<br>

}<br>

<br>So I let make the final decision to the maintainers.<br>
<br>Cheers,<br>&nbsp;&nbsp;&nbsp; Michel<br><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic