On Tue, 2006-05-23 at 21:40 +0200, Henrik Nordstrom wrote: > tis 2006-05-23 klockan 15:01 -0400 skrev Nick Lewycky: > > > If possible, it should store the HttpHeaderEntry objects themselves > > instead of pointers to them. Done properly, there shouldn't be any need > > for a destructor at all. > > In this case there was a const barrier which needed to be penetrated, > triggering all of this.. Probably a design error somewhere (missing > write access method, or the code in question executing in the wrong > context). > > > if not possible, then HttpHeader should either have an explicit copy > > constructor which does the right thing, or else be non-copyable by > > adding unimplemented private copy constructor and operator= . See > > http://www.boost.org/boost/noncopyable.hpp for the technique. > > The latter I think here.. this kind of objects is best copied > explicitly, and C++ is a bit too keen on making copy easy via the normal > methods..
This is why, in our C++ guidelines we have 'always create copy constructor and assignment operators - leave unimplemented if desired'. :) I'm not sure where they are now, but I remember discussing them way back. Rob -- GPG key available at: <http://www.robertcollins.net/keys.txt>.
signature.asc
Description: This is a digitally signed message part
