Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.unix.programmer,comp.lang.c Subject: Re: Odd compiler behaviour? Date: Tue, 08 Mar 2016 15:28:43 +0000 Lines: 21 Message-ID: <87y49tt2dw.fsf@doppelsaurus.mobileactivedefense.com> References: <20160301061135.783@kylheku.com> <87h9gqb0lj.fsf@mantic.terraraq.uk> <878u22aua9.fsf@mantic.terraraq.uk> <87wpplaojy.fsf@mantic.terraraq.uk> <20160305152935.13fa72e4c5e160164248c79c@speakeasy.net> <871t7ldt2g.fsf@doppelsaurus.mobileactivedefense.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net ZMLNF3xl//qcl6Yv9kEWTwHJ+6VmVGsRomMABiVUODR2A/fWQ= Cancel-Lock: sha1:lsNFdQ9ZmczMEvQ4I76gVKGIw3U= sha1:rigw5P7InvicThvAu4tVCk5lxFg= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Xref: csiph.com comp.unix.programmer:8060 comp.lang.c:83469 spud@potato.field writes: > On Tue, 08 Mar 2016 12:59:03 +0000 Rainer Weikusat wrote: [...] >>An operator symbol denotes a principially arbitrary function supposed to >>be applied to some elements which a members of a certain set. That's >>mathematics and not C++, hence, C++ is hardly to blame here. > > In programming a + sign should always mean some sort of addition. That's an opinion on 'sensible use of operator symbols' and not everyone agrees with it. > To overload the operator and then do something else is abusing the > intent of overloading and confuses maintenance coders. In particular, both C++ and Perl support associating arbitrary (to some degree) meanings with operator symbols when applied to objects of user-defined types and this also happens to be the mathematical definition.