Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: reference parameters for overloaded operators Message-ID: <402@taumet.com> Date: 16 Aug 90 16:36:01 GMT References: <1990Aug13.144540.7804@ctk1.UUCP> Organization: Taumetric Corporation, San Diego Lines: 17 chris@ctk1.UUCP (Chris Old) writes: |When should one use references rather than passing by value to |overloaded operators? |I realise that references will save some overhead for large structures, |but the rather scanty manual I have, seemed to indicate that there is |another reason. The overhead can be significant even for a small structure, since the copy constructor must be called to initialize the formal parameter. The return value must be a reference if you want an lvalue, such as for operator[]. -- Steve Clamage, TauMetric Corp, steve@taumet.com