← Back to team overview

kicad-developers team mailing list archive

Re: About the NextColor function

 

Le 06/04/2013 14:25, Lorenzo Marcantonio a écrit :
I'm not too happy to discard the convenience of C++ operator overloading
only to fix a swig warning...

Other than that, if we have to need a named function at least we should
have it in functional fashion like col = NextColor(col) or a better name
like Advance(col); actually Advance(&col), since we decided not to use
nonconst references... in my private branch I am using ADTs even for
LAYER_NUM and LAYER_MSK (implemented as enum but ready for 'upgrade');
it would be a real mess to not being able to use operators ++, & and
| (for example).

Do we really want to make without operator overloading? Being from
a LISP background I have no issue with that (since there are no
operators and everything is prefix, anyway) but in C++ this is... ugly.

I'd like to discuss this (since I have a lot of ++, & and | done on
layers, now...)
I am not a swig specialist.
Certainly, we could ignore swig warnings (by disabling these warnings),
but ignoring warnings (unless we know exactly the consequence) is always a bit annoying (generally speaking). Perhaps a swig specialist could say if (or when) operator overload warnings can be safely disabled.
Obviously, "col = NextColor(col)" can be replaced by a better function.

--
Jean-Pierre CHARRAS



Follow ups

References