delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/14/01:10:02

Date: Thu, 14 Sep 2000 07:08:02 +0200
From: Egon Eckert <egon AT chance DOT cz>
To: djgpp AT delorie DOT com
Subject: Re: Operator definitio in DJGPP
Message-ID: <20000914070802.B7319@chance.cz>
References: <lGSv5.7$c24 DOT 2300 AT news2 DOT bora DOT net>
Mime-Version: 1.0
User-Agent: Mutt/1.0.1i
In-Reply-To: <lGSv5.7$c24.2300@news2.bora.net>; from widder@chollian.net on Wed, Sep 13, 2000 at 09:52:17PM +0000
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

>     --> color& operator+ (const color &,const color &);
>     --> color& operator+ (const color &);

The latter (one argument) is what you have to use when the operator is a
member of a class (color, I suppose).  '* this' will be the 1st (= left)
argument then.  Use the former (two arguments) when the operator should not
be a member of any class -- this is what you may freely choose.

BTW I guess it would be more correct if you would return just 'color', not a
reference, but I'm not sure.

-- 
Egon Eckert, Chance, a.s.
E-mail: egon AT chance DOT cz

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019