RE: [Boost-Users] Re: boost::noncopyable usage question
According to the C++ Standard, 12.8/10, the assignment operator cannot be inherited because if it is not provided, the compiler will provide one implicitly. Or at least, that is my understanding of it. Given this, how can boost::noncopyable work?
On Wednesday, June 5, 2002, at 03:14 PM, Michael Davis wrote:
According to the C++ Standard, 12.8/10, the assignment operator cannot be inherited because if it is not provided, the compiler will provide one implicitly. Or at least, that is my understanding of it.
Given this, how can boost::noncopyable work?
The assignment operator provided by the compiler for the class derived from noncopyable has to copy the part of the object that's inherited from noncopyable. To do that, it has to use the assignment operator from the noncopyable class; but if it's inaccessible, like the private one in noncopyable, it has to report an error. This rule is mentioned in 12.8/14. -- Darin
participants (2)
-
Darin Adler
-
Michael Davis