D - [bug?] enum xxx : char[]
- C. Sauls (21/21) Apr 17 2004 Are enum's not allowed to derive from char[]? The following generates
- J C Calvarese (7/30) Apr 17 2004 I think enums are only allowed to be uint or int, but I'm not sure
- Walter (4/6) Apr 17 2004 No, only integral types. It's a bug in the documentation, and a bug in t...
- Kris (5/26) Apr 17 2004 .. and you can't (currently) use version{} inside an enum; would be hand...
Are enum's not allowed to derive from char[]? The following generates
the given errors:
------------------------------constants.d
16: enum EXT : char[] {
17: version (Win32) {
18: SRC = "d",
19: OBJ = "obj",
20: LIB = "lib"
21: }
22:
23: version (linux) {
24: SRC = "d",
25: OBJ = "o",
26: LIB = "a"
27: }
28: }
------------------------------
constants.d(16): { enum members } expected
constants.d(16): Declaration expected, not '['
-C. Sauls
-Invironz
Apr 17 2004
C. Sauls wrote:
Are enum's not allowed to derive from char[]? The following generates
the given errors:
------------------------------constants.d
16: enum EXT : char[] {
17: version (Win32) {
18: SRC = "d",
19: OBJ = "obj",
20: LIB = "lib"
21: }
22:
23: version (linux) {
24: SRC = "d",
25: OBJ = "o",
26: LIB = "a"
27: }
28: }
------------------------------
constants.d(16): { enum members } expected
constants.d(16): Declaration expected, not '['
-C. Sauls
-Invironz
I think enums are only allowed to be uint or int, but I'm not sure
because "enum Name : type" hasn't been documented yet (or the
documentation has been lost).
--
Justin
http://jcc_7.tripod.com/d/
Apr 17 2004
"J C Calvarese" <jcc7 cox.net> wrote in message news:c5sea7$2mgk$1 digitaldaemon.com...C. Sauls wrote:No, only integral types. It's a bug in the documentation, and a bug in the compiler.Are enum's not allowed to derive from char[]?
Apr 17 2004
.. and you can't (currently) use version{} inside an enum; would be handy if
you could.
- Kris
"C. Sauls" <ibisbasenji yahoo.com> wrote in message
news:c5sbpb$2j3s$1 digitaldaemon.com...
Are enum's not allowed to derive from char[]? The following generates
the given errors:
------------------------------constants.d
16: enum EXT : char[] {
17: version (Win32) {
18: SRC = "d",
19: OBJ = "obj",
20: LIB = "lib"
21: }
22:
23: version (linux) {
24: SRC = "d",
25: OBJ = "o",
26: LIB = "a"
27: }
28: }
------------------------------
constants.d(16): { enum members } expected
constants.d(16): Declaration expected, not '['
-C. Sauls
-Invironz
Apr 17 2004
"Kris" <someidiot earthlink.dot.dot.dot.net> wrote in message news:c5sg1p$2opt$1 digitaldaemon.com..... and you can't (currently) use version{} inside an enum; would be handyifyou could.Matthew argued for this as well, but I don't agree. Visually, it looks cluttered to put versions down at such a low level. Version differences should be at a higher level.
Apr 17 2004
Oh, I just meant that it could be convenient at times; I wouldn't want to argue over such an idiosyncrasy when there's bigger fish to fry; such as additional AA properties to pre-allocate and clear ... <g> "Walter" <walter digitalmars.com> wrote in message news:c5t4uo$o10$1 digitaldaemon.com..."Kris" <someidiot earthlink.dot.dot.dot.net> wrote in message news:c5sg1p$2opt$1 digitaldaemon.com...handy.. and you can't (currently) use version{} inside an enum; would beifyou could.Matthew argued for this as well, but I don't agree. Visually, it looks cluttered to put versions down at such a low level. Version differences should be at a higher level.
Apr 18 2004









"Walter" <walter digitalmars.com> 