|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
D - extending enums
I thought it would be fine if enums were extensible:
enum Color { red, green, blue };
// somewhere later
enum Color { yellow, cyan, magenta }; // Color.yellow = Color.blue +
1
Not useful as is, but could be very handy if applied
to class hierarchy. So the base class declares the
enum and introduces basic options common for all, and
then child classes add options specific to their
functionality.
Or maybe use the class syntax for enums, with inheritance
and such? A stupid idea, probably, but... =)
Nov 24 2001
This idea has come up before, and it's a good one. -Walter "Pavel Minayev" <evilone omen.ru> wrote in message news:9to6n8$12d6$1 digitaldaemon.com... Nov 24 2001
|