Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2003-02-03 11:40:49


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:001b01c2cb95$de5e8fe0$1d00a8c0_at_pdimov2...
> [...]
> And finally Mojo approximates:
>
> public:
> mojoized(mojoized const & rhs); // can copy
> mojoized(mojoized && rhs); // but can also move for efficiency reasons

Really? http://www.cuj.com/experts/2102/alexandr.htm?topic=experts
has:

class mojo_ptr : public mojo::enable<mojo_ptr>
{
    // *** Here ***
    mojo_ptr(const mojo_ptr&); // const sources are NOT accepted
public:
    // source is a temporary
    mojo_ptr(mojo::temporary<mojo_ptr> src)
    {
        mojo_ptr& rhs = src.get();
        ... use rhs to perform a destructive copy ...
    }
    // source is a function's result
    mojo_ptr(mojo::fnresult<mojo_ptr> src)
    {
        mojo_ptr& rhs = src.get();
      ... use rhs to perform a destructive copy ...
    }
    ...
};

That looks like Howard's protocol to me, unless I'm missing
something. I understand Howard's point now, which is the
important thing.

In fact, my understanding is that Howard's move_ptr *is* more
similar to mojo_ptr than auto_ptr, because auto_ptr has
auto_ptr(auto_ptr&), which is exactly the thing Howard is
crusading against.

Dave


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