|
Boost Users : |
From: Leon Mlakar (leon.mlakar_at_[hidden])
Date: 2007-04-26 04:31:48
> >>
> >> > The copy constructor argument Richard Hadsell mentioned I
> >> hadn't even
> >> > considered and it is a good argument in its own right.
> >>
> >> I would like to strengthen Richard's remarks: The newly proposed
> >> class violates the "rule of three", because it define's the d'tor,
> >> but forget's to implement copy c'tor and copy-assignment op (which
> >> is, as Richard already said, a bad idea here).
> Astonishingly for an
> >> expert...
> >
> > This really should be emphasized. Having a pointer to dynamically
> > allocated buffer without custom copy constructor/copy
> > assignment?Sooner or later somebody will try to copy it ...
>
> Please read the docs! There is clearly written that this
> class is derived from noncopyable (boost utility class!!!).
>
> The source does not contain the derivation but define private
> declarations of copy ctor and assignment operator. So there
> is no way to copy this class.
Not the original Context class, no. I was refering to the so called
optimized version. I see no private copy ctor and assignment operator there.
Leon
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