Re: Operator overloading problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> bruno@xxxxxxxxxxxxx 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




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux