This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Operator overloading problems
> 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