|
Boost Users : |
From: Darin Adler (darin_at_[hidden])
Date: 2002-06-05 23:57:12
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
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