Boost logo

Boost :

From: Christopher Currie (codemonkey_at_[hidden])
Date: 2004-07-16 15:07:30


Michael Glassford wrote:
>> If there's enough hew and cry for a movable lock, then we should
>> create a new class for it. That said, most of the arguments I could
>> find on the list archive for it are to support syntax changes in
>> initializing a scoped lock.
>
>
> Did you see http://aspn.activestate.com/ASPN/Mail/Message/boost/1207226,
> and especially http://aspn.activestate.com/ASPN/Mail/Message/1209126?

No I hadn't (kudos to you for digging this up!). It's good stuff,
similar in spirit to my post, the major difference is that Bill's
suggestion attempts to implement real move semantics, whereas my sketch
was simply an initialization convenience.

I'll spend some time looking at the thread in more detail later when I
have time, but my initial impression is that although the ability to
create a lock and return it out of a function may make certain
techniques easier, I don't think the lack of it makes them impossible.

Specifically, I have a sketch in my head of locking_ptr<> that wouldn't
require move semantics, but I'd have to see what code Bill had in mind.
I reread the Stroustrop article, which I'd seen before, and I can
imagine how his Wrap<> could be used with our existing locks and boost::ref.

Christopher

-- 
Christopher Currie <codemonkey_at_[hidden]>

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