Boost logo

Boost Users :

Subject: Re: [Boost-users] noncopyable and move semantics
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-07-26 14:04:19


> On 25 July 2011 18:04, Nathan Ridge
> <zeratul976_at_[hidden]<mailto: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?

Less typing and more self-documenting than doing it yourself?
 
Isn't that what boost::noncopyable was for in C++03, too?
 
Regards,
Nate.


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