Path: utzoo!attcan!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: reference parameters for overloaded operators Message-ID: <56749@microsoft.UUCP> Date: 20 Aug 90 19:03:55 GMT References: <1990Aug13.144540.7804@ctk1.UUCP> <26CBE285.4EC2@tct.uucp> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 11 In article <26CBE285.4EC2@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: >According to chris@ctk1.UUCP (Chris Old): >>When should one use references rather than passing by value to >>overloaded operators? > >I have found references useful as parameters when the objects passed >as parameters cannot be copied cheaply (or at all). Also, whenever doing polymorphic programming [as in vtables and virtual functions, not polymophic via parameter overloading] one should call by reference to avoid the slicing problem.