Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!apollo!mrst!sdti!turner From: turner@sdti.SDTI.COM (Prescott K. Turner) Newsgroups: comp.lang.c++ Subject: Re: references in aggregates Summary: no array of reference Message-ID: <457@sdti.SDTI.COM> Date: 12 May 89 16:09:00 GMT References: <4569@psuvax1.cs.psu.edu> Reply-To: turner@sdti.UUCP (0006-Prescott K. Turner, Jr.) Organization: Software Development Technologies, Sudbury MA Lines: 19 In article <4569@psuvax1.cs.psu.edu> schwartz@shire.cs.psu.edu (Scott Schwartz) writes: >Is it possible to declare an aggregate containing references? >Something like > Class& vec[] = ??? >is what I had in mind, but don't see how to make the initializations >work out. Arrays of references are not allowed. But a reference can be a member of a class, just initialize it in the base/member initializer. int n; class C { int & intref; C () : intref (n) {} }; -- Prescott K. Turner, Jr. Software Development Technologies, Inc. P.O. Box 366, Sudbury, MA 01776 USA (508) 443-5779 UUCP: ...{harvard,mit-eddie}!sdti!turner Internet: turner@sdti.sdti.com