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 20:38:47 +0000 Lines: 20 Message-ID: <87bn6ou2lk.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> <87y49tt2dw.fsf@doppelsaurus.mobileactivedefense.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net L/B0HxXDEkEHgbY0pjvlkALF5ivPxCO54HaDZFBXXuDM3idr0= Cancel-Lock: sha1:kJRwbTxqev3T9Dmr7cn1UqZIQOE= sha1:/dxarUPmY747WsIWLbRYP2cGvG4= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Xref: csiph.com comp.unix.programmer:8065 comp.lang.c:83493 Barry Margolin writes: > Rainer Weikusat wrote: >> spud@potato.field writes: [...] >> > 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. > > Didn't I say way back when that this is one of the big differences > between C and C++? Programmable operator overloading means that > intuitive notions about the operators are less likely to be correct. My intuitive notion of the meaning of + is "x turned by 45 degrees" ... but - oh wait - that's based on something else I had to memorize ...