enum's & KConfigBase

André Wöbbeking Woebbeking at onlinehome.de
Tue Jan 17 21:40:11 GMT 2006


On Tuesday 17 January 2006 00:40, Stefan Teleman wrote:
> On Monday 16 January 2006 17:41, Dirk Mueller wrote:
> > I'm not so sure if its a good idea to convert enums to integers and
> > back. enum's tend to be reordered within applications, which break
> > binary compatibility (not a problem usually for inner-apps usage)
> > but then also breaks configuration reading. This is a major
> > problem. KDE applications break already way too often their own
> > configuration (I cannot remember how often already I had to redo
> > the very same settings in e.g. konversation because the way the
> > configuration key was stored was changed *yet another* time). We
> > shouldn't make it too easy to keep that nasty habit.
>
> Not to mention the fact that in C++ the sign-ness and the underlying
> type used to represent an enum type are implementation-defined,
> therefore the conversion to a signed integer creates a big
> portability problem right from the start. It is common to have enums
> implemented as bitfields.

FYI, at least with VC 6 enums are signed, i.e. for the enum values 0, 1 
you need 2 bits.




More information about the kde-core-devel mailing list