Boost logo

Boost Users :

Subject: Re: [Boost-users] noncopyable and move semantics
From: Nevin Liber (nevin_at_[hidden])
Date: 2011-07-26 12:35:38


On 25 July 2011 18:04, Nathan Ridge <zeratul976_at_[hidden]> wrote:

>
> struct S : boost::noncopyable
> {
> S(S&&) = default;
> };
>
> The problem is that the default move constructor for S tries to move the
> noncopyable base subobject, but noncopyable does not have a move
> constructor (one isn't generated implicitly because a user-defined copy
> constructor is present). Then it tries to fall back to the noncopyable
> copy constructor, but that of course is private.
>

Doesn't the problem go away if you don't use boost::noncopyable at all? If
one agrees that the C++0x mechanism is superior, is there still a use case
under C++0x for boost::noncopyable?

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net