Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 2000-05-25 13:28:57


From: "Ed Brey" <brey_at_[hidden]>
> > class noninstantiable : protected noncopyable {
> > private:
> > noninstantiable(){}
> > }; // noninstantiable
>
> Just like the copy constructors noncopyable, there should not be an
> implementation for the default constructor in noninstantiable;
> otherwise, a friend could instantiate it. A situation where only
> friends instantiate is unusual enough that it warrants setting up
the
> restriction constructors by hand, rather than relying on a
convenience
> base class such as noninstantiable to do it.

Of course, since noninstantiable doesn't specify any friends, and the
constructor is private, my argument is rather pointless since nothing
can access the constructor's implementation anyway. My arguement
really should have been that since the constructor implementation is
can never be used, there shouldn't be one.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk