This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Operator overloading problems
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: bruno at codata dot com dot br
- Cc: gcc-help at gcc dot gnu dot org
- Date: 17 Oct 2003 14:27:43 +0200
- Subject: Re: Operator overloading problems
- References: <4189.200.241.198.129.1066388956.squirrel@mail.codata.com.br>
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.
--
Falk