Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!agate!shelby!neon!Gang-of-Four!dkeisen From: dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) Newsgroups: comp.lang.c++ Subject: Re: Smart pointers and stupid people (was: garbage collection...) Message-ID: <1991Jan3.180120.5689@Neon.Stanford.EDU> Date: 3 Jan 91 18:01:20 GMT References: <1990Dec20.045909.7681@rice.edu> Sender: news@Neon.Stanford.EDU (USENET News System) Organization: Sequoia Peripherals Lines: 25 >In article <3071@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes: > > >Sounds to me that you want class T to be `owned' by class smart_pointer_to_T. >Or said another way, you want class T to be hidden `inside' smart_ptr_to_T. >Sounds like `nested classes' fit the bill! > >class smart_ptr_to_T { > class T { > //... > }; It seems to me that nested classes raise some of the issues that C so successfully avoided by not allowing nested function declarations. C code is easy to read in part because the scope of things is pretty clear from the text; anything that moves away from that is a step in the wrong direction. -- Dave Eisen There's something in my library 1447 N. Shoreline Blvd. to offend everybody. Mountain View, CA 94043 --- Washington Coalition Against Censorship (415) 967-5644 dkeisen@Gang-of-Four.Stanford.EDU