
11 Dec
2008
11 Dec
'08
3:19 a.m.
From: Neal Becker Steven Watanabe wrote:
It looks like the arithmetic operators may need to be overloaded rather than relying on implicit conversions?
If you mean that they should be overloaded by the library itself, then this is not necessarily a good idea. It is not possible to guess what should be the best return type of arithmetic operators in general case. For some applications returning a constrained value would be OK (but again there is the problem that the constraint may reject the modified value) while for others it's better to return the underlying type.