Using C++ in GCC is OK
Paolo Bonzini
bonzini@gnu.org
Wed Jun 2 14:23:00 GMT 2010
On 06/02/2010 03:54 PM, Ian Lance Taylor wrote:
> Richard Guenther<richard.guenther@gmail.com> writes:
>
>> On Tue, Jun 1, 2010 at 6:58 PM, Ian Lance Taylor<iant@google.com> wrote:
>>> Richard Guenther<richard.guenther@gmail.com> writes:
>>>
>>>> Overall the wiki document looks good. I'd like to disallow
>>>>
>>>> * Operators may only be overloaded for types which implement numeric
>>>> values, where the overloaded operators implement the usual numeric
>>>> semantics.
>>>>
>>>> though.
>>>
>>> My thinking here is that it would be reasonable to implement
>>> real_arithmetic and mpfr/mpc using overloaded operators. I could
>>> certainly be wrong.
>>
>> It will hide the cost which is IMHO not wanted.
>
> I agree that that is the usual problem with overloaded operators. I
> don't really agree that that is a problem in this specific case. We
> have to do those operations anyhow. I don't think the ease of writing
> the code is going to cause us to do extra operations in the target
> floating point format.
As mentioned elsewhere in this huge thread, I'd like to allow operator++
(preincrement), operator==, operator!= and operator* (unary) for
iterators. That is, only forward input operators. We're going to use
them anyway for the STL, so we might as well use them for bitmaps etc.
Paolo
More information about the Gcc
mailing list