Re: a+b+c is not equal to a+(b+c)
From: Adrian (nntp_at_bluedreamer.com)
Date: 10/26/04
- Next message: Chris \( Val \): "Re: Reading a file from a specified range"
- Previous message: Keith Thompson: "Re: C to Java Byte Code"
- In reply to: Gunnar G: "Re: a+b+c is not equal to a+(b+c)"
- Next in thread: Peter Koch Larsen: "Re: a+b+c is not equal to a+(b+c)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 26 Oct 2004 07:47:00 +0000 (UTC)
Gunnar G wrote:
> Why would that be better? I thought the result would be the same? That is,
> operator+(a,b) is the same as a+b.
Becuase that way you can write
1. a+5
2. 5+a
3. a+b
If operator+ is a friend a Bigint will automatically be constructed for
1 and 2 if needed. As a member function option 2 isn't possible
Adrian
- Next message: Chris \( Val \): "Re: Reading a file from a specified range"
- Previous message: Keith Thompson: "Re: C to Java Byte Code"
- In reply to: Gunnar G: "Re: a+b+c is not equal to a+(b+c)"
- Next in thread: Peter Koch Larsen: "Re: a+b+c is not equal to a+(b+c)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]