From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23788 invoked by alias); 17 Oct 2003 13:04:22 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 23778 invoked from network); 17 Oct 2003 13:04:21 -0000 Received: from unknown (HELO codata.com.br) (200.241.198.143) by sources.redhat.com with SMTP; 17 Oct 2003 13:04:21 -0000 Received: from codata.com.br (localhost [::ffff:127.0.0.1]) (AUTH: LOGIN bruno@codata.com.br) by codata.com.br with esmtp; Fri, 17 Oct 2003 10:06:11 -0200 Received: from 200.241.198.129 (SquirrelMail authenticated user bruno@codata.com.br) by mail.codata.com.br with HTTP; Fri, 17 Oct 2003 10:06:11 -0200 (BRST) Message-ID: <4266.200.241.198.129.1066392371.squirrel@mail.codata.com.br> Date: Fri, 17 Oct 2003 13:04:00 -0000 Subject: Re: Operator overloading problems From: bruno@codata.com.br To: falk.hueffner@student.uni-tuebingen.de In-Reply-To: <87brsgkq0w.fsf@student.uni-tuebingen.de> References: <4189.200.241.198.129.1066388956.squirrel@mail.codata.com.br> <87brsgkq0w.fsf@student.uni-tuebingen.de> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: gcc-help@gcc.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2003-10/txt/msg00294.txt.bz2 > bruno@codata.com.br writes: > >> Hi all, >> >> I'm having problems trying to compile the following sample code: >> >> // Byte / Byte >> Byte operator/ (Byte& b) const { >> return Byte (value / b.value); >> } > > The argument needs to be a const reference. In this case, since Byte is > so small, I'd just pass it by value, though. > Ok. It worked with const references. Thank you. Bruno. > -- > Falk