From: | Alexander Niven-Jenkins |
Date: | 16 Jul 2000 at 16:34:39 |
Subject: | Re: overloading operators |
Hiya James,
On 15-Jul-00, you wrote:
>> I guess, off the to of my head I can't think what the return type of<<
>> is, if there is one, but I think it would be done as?
>>
>> rettype myprintclass :: operator << ( const char* &rhs ) const
>> {
>> out( rhs );
>> }
>>
>> rettype myprintclass :: operator << ( const int &rhs ) const
>> {
>> out( rhs );
>> }
> Not quite, operators have implicit return types, so you cannot declare
> or define them with any return-type (not even void).
I know that, that's why I said 'I can't remember off the top of my head
the return type' and so just put the return type as rettype to represent
that it wasn't void.
Sorry if confusion was caused.
Kind regards...
Alex
------------------------------------------------------------------------
It's the End Of The Line for My Shipping Broker.
http://click.egroups.com/1/5175/1/_/451227/_/963775122/
------------------------------------------------------------------------