This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

-- 
	Falk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]