Article View: comp.std.c++
Article #3868Re: double const declarations
From: James Christodouleas
Date: Sat, 30 Mar 1996 06:03
Date: Sat, 30 Mar 1996 06:03
37 lines
1969 bytes
1969 bytes
In article <4jdvnj$o35@mulga.cs.mu.OZ.AU>, fjh@munta.cs.mu.OZ.AU (Fergus
Henderson) wrote:
> Philippe Verdy <100105.3120@compuserve.com> writes:
>
> >template <class T, class CT>
> >class SmartPtr2 {
> > SmartPtr2(T* p) { mp = const_cast<CT>(p) ; }
> > CT & Dereference() {
> > return *mp ;
> > }
> > private :
> > CT *mp ;
> >} ;
> >template <class T> class ConstSmartPtr : SmartPtr<T, T> {} ;
> >template <class T> class FreeSmartPtr : SmartPtr<T, const T> {} ;
>
> You forgot to delegate the constructors.
>
> (Of course, if C++ supported tempate typedefs, there wouldn't be
> any need to delegate constructors in examples like this.
> Unfortunately it doesn't.)
What does it mean to "delegate constructors?" I looked it up in Coplien,
Advanced C++, and he talks about delegation to mean different classes
sharing functionality dynamically.
What do you mean here?
Jim Christodouleas
jchristo@mit.edu
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Technical Details
Message-ID:
<QQajel16319.199603292150@relay1.UU.NET>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<4jc2fa$bqu@arl-news-svc-2.compuserve.com> <4jdvnj$o35@mulga.cs.mu.OZ.AU>Show Full Headers
Complete Article Headers
From: jchristo@mit.edu (James Christodouleas) Message-ID: <QQajel16319.199603292150@relay1.UU.NET> X-Original-Date: Fri, 29 Mar 96 16:50:32 EST Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 30 Mar 96 06:03:06 GMT Approved: fjh@cs.mu.oz.au Newsgroups: comp.std.c++ Subject: Re: double const declarations Organization: Mass Inst of Technology and Draper Laboratory, Inc References: <4jc2fa$bqu@arl-news-svc-2.compuserve.com> <4jdvnj$o35@mulga.cs.mu.OZ.AU> X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMVzO0OEDnX0m9pzZAQErdAF/VrRXw9RUdvwd1Kd6poveEZykT9DleX4j 2q+b0hY7EMxKWJjSqPf4iroSWjKOalHc =fT3w