|
Boost : |
From: Christopher Currie (codemonkey_at_[hidden])
Date: 2004-07-19 15:30:38
Eric Niebler wrote:
> This won't work. Try to compile this with Comeau online:
> You'll get:
>
> "ComeauTest.c", line 13: error: "scoped_lock::scoped_lock(const
> scoped_lock &)",
> required for copy that was eliminated, is inaccessible
> scoped_lock l = lock_transfer();
> ^
>
> Non-copyable types can't be initialized this way. The code I posted
> earlier worked around this problem by enabling just enough move
> semantics to allow a lock to be returned from a function, but nothing
> else. The lock is still non-copyable.
*pouts* Well, fooey. Glad you got it working, though, I missed that
post. My point still stands, I think the movable lock should be a
separate type from the scoped lock, even if we implement minimal move
semantics to support assignment initialziation.
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