----- Original Message -----
> From: Lorenzo Marcantonio <[email protected]>
> To: Kicad Developers <[email protected]>
> Cc: 
> Sent: Friday, August 3, 2012 8:45 PM
> Subject: Re: [Kicad-developers] operator == on PCB_PLOT_PARAMS
> 
> On Fri, Aug 03, 2012 at 12:39:52PM +0200, Lorenzo Marcantonio wrote:
>>  Why is the operator definition needed? If the semantic is a field-by-field 
> comparison, it should get a default, like for assigment (it doesn't, tried 
> it:P)
> 
> Oops found the answer... there is no default == operator in C++ :P:P 
> (strange, 
> they got default = but not default ==)
> 
> -- 
> Lorenzo Marcantonio
> Logos Srl
> 

It's very simple; for an '=' operator you only need to copy a known amount of 
memory to provide a default operator which is useful in almost 100% of cases.  
There is no such generalization possible for the equivalence operator if a 
parameter is anything more than a single CPU register.  For example, consider 
the quaternion represented by a structure containing 4 floats.  When you check 
for the equivalence of the quaternions you only need to check 3 of those 
floats; if the quaternions are not normalized then you cannot even directly 
compare the 3 values to determine if the quaternions are equivalent.  In my 
experience this situation is extremely common so I am not surprised that there 
is no default '==' operator.

- Cirilo

_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to