Xref: utzoo comp.lang.c++:4211 gnu.g++:315 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!orca!demiurge!brucec From: brucec@demiurge.WV.TEK.COM (Bruce Cohen;685-2439;61-028) Newsgroups: comp.lang.c++,gnu.g++ Subject: Re: Where does this construct come from? Message-ID: <4079@orca.WV.TEK.COM> Date: 1 Aug 89 01:39:26 GMT References: <2701@hsinchu.sw.mcc.com> Sender: nobody@orca.WV.TEK.COM Reply-To: brucec@demiurge.WV.TEK.COM (Bruce Cohen) Followup-To: comp.lang.c++ Organization: Tektronix, Inc., Wilsonville, OR Lines: 18 In article <2701@hsinchu.sw.mcc.com> knutson@hsinchu.sw.mcc.com (Jim Knutson) writes: >What does this construct mean and where does it come from? > >class multi_v { >public: > vect a, b, c; > multi_v(int i):a(i), b(i), c(i) { } > // ^^^^^^^^^^^^^^^^^ >}; That's the way to pass arguments to the constructors of the member objects a, b, and c, so they are constructed before the containing object. This is described in Stroustrup, pp. 159-161. Bruce Cohen brucec@orca.wv.tek.com Interactive Technologies Division, Tektronix, Inc. M/S 61-028, P.O. Box 1000, Wilsonville, OR 97070