Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-30 15:10:52


From: "Ed Brey" <brey_at_[hidden]>
>
> "David Abrahams" <dave_at_[hidden]> wrote in message
news:100001c268b1$f56e6cb0$6501a8c0_at_boostconsulting.com...
> > From: "Ed Brey" <brey_at_[hidden]>
> >
> > > My contention is that not only are transfer semantics needed for the
> > particular application we were discussing, but that transfer semantics
are
> > needed for *any* application. In RAII, the "acquisition" is performed
by a
> > transfer.
> >
> >
> > Oh, please!
> > RAII has never been well-defined and there's nothing in its name which
> > implies the acquisition is done by transfer-of-ownership. In fact, if
you
> > believe there's some power in the name, it's easy to interpret this as
> > RAII:
> >
> > struct foo
> > {
> > struct body;
> > foo() : b(new body) {} // <===
> > ~foo() { delete body; }
> > body* b;
> > };
>
> I didn't mean to imply that RAII necessarily involves transfer of
ownership - just that scoped_ptr does. And so using scoped_ptr to
implement a RAII concept involves a transfer of ownership, or at least
syntax that is indistinguishable from a usage that would involve such
transfer.

Okay. I probably overreacted; I keep hearing overly-definitive
pronouncements about RAII.

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk