Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!alias!fred!rae From: rae@gpu.utcs.toronto.edu (Reid Ellis) Newsgroups: comp.lang.c++ Subject: Re: Need `set before used' warning Message-ID: Date: 5 Oct 90 14:25:47 GMT References: <2@mtnmath.UUCP> <1990Sep27.001259.25809@relay.wpd.sgi.com> <195@c.procase.UUCP> <11745@cadillac.CAD.MCC.COM> <1990Oct4.063119.10626@odi.com> Sender: Reid Ellis Reply-To: Reid Ellis Organization: Alias Research, Inc. Toronto ON Canada Lines: 17 Paul Vaughan writes: >I've been tending to use the initialization form more and more, but I >don't really have a good reason for why I should do that. If you ever pass your object X to a function/method that expects a "(const X)" and you use '=' to initialize your fields, then you can't call that function. It fails when it tries to construct a const X since the constructor is attempting to use '=' on a const object. Usually this doesn't come up since you would typically pass "(const X &)" instead, but I thought I'd point it out. Reid -- Reid Ellis 264 Broadway Avenue, Toronto ON, M4P 1V9 Canada rae@gpu.utcs.toronto.edu || rae%alias@csri.toronto.edu || +1 416 487 1383