Revised RFC on range design for D2

Bill Baxter wbaxter at gmail.com
Fri Sep 12 08:50:01 PDT 2008


On Sat, Sep 13, 2008 at 12:29 AM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> Bill Baxter wrote:
>> r1=r.release  ==> r.transfer?  Release sounds like ref counting (e.g. in
>> COM)
>>                          Also seems like r.transfer(r1) could make
>> implementation more efficient.
>>                          Or perhaps make it a .swap like STL.  Maybe
>> you have something against .swap?
>
> Are you kidding? I wrote the best swap in the world. Check the source of
> std.algorithm.

I mean like stdvector.swap(stdvector0), not the algorithm swap.  Or
maybe your swap subsumes both kinds?

> You'll have to convince Bartosz about dropping the name "release". He held a
> gun to my head, and five of the six chambers were loaded. Couldn't take the
> risk.


Hmm.  I would have thought Walter would veto "release" since he cared
enough about COM to write it into the D spec.   Release is *the* word
used throughout COM to signal that you want to decrement an objects
reference counter.  So basically you do an obj->Release on a COM
object any time you would have done a "delete obj" on a regular
object.

> As far as efficiency goes, Walter has RVO down and all so I'm not
> worried.

What if you don't put a return object there?  Will that be ok too?
Even if there are OS resources and such involved?

--bb


More information about the Digitalmars-d-announce mailing list