Boost logo

Boost Users :

Subject: Re: [Boost-users] use of boost::noncopyable ?
From: Lars Viklund (zao_at_[hidden])
Date: 2012-03-24 18:22:50


On Sat, Mar 24, 2012 at 11:01:30AM -0500, John M. Dlugosz wrote:
> On 3/21/2012 2:18 AM, Igor R wrote:
>>
>> To get more helpful error, declare a private copy-ctor& assignment
>> operator in your class - and you'll see who attempts to copy.
>
> That's what I did. So is there anything that boost::noncopyable does for
> me beyond that, or did I just make it totally redundant?

The downside of the private declare-and-not-implement is that if the
copy attempt is in a member function or friend, the error does not
surface until linking time, where all the context of use is completely
obliterated.

-- 
Lars Viklund | zao_at_[hidden]

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