Autor Beitrag
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 28.04.17 05:49 
- Nachträglich durch die Entwickler-Ecke gelöscht -
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4764
Erhaltene Danke: 1052

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Fr 28.04.17 09:38 
Hallo,

in der C#-Specification (u.a. zu finden lokal unter C:\Programme (x86)/Microsoft Visual Studio 12.0/VC#/Specifications/1033) steht unter "14.1 Enum declarations":
Zitat:
Each enum type has a corresponding integral type called the underlying type of the enum type. This underlying type must be able to represent all the enumerator values defined in the enumeration. An enum declaration may explicitly declare an underlying type of byte, sbyte, short, ushort, int, uint, long or ulong. Note that char cannot be used as an underlying type. An enum declaration that does not explicitly declare an underlying type has an underlying type of int.

Generell sind aber die C#-Schlüsselwörter wirklich nur Aliasnamen für die .NET-Typen, aber anscheinend wurden bei den enums explizit nur die C#-Schlüsselwörter spezifiziert.
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4700
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Fr 28.04.17 10:09 
Das würde ich da auch so reininterpretieren das es wichtig war Schlüsselwörter zu benutzen. Da Aliase eben auch Schlüsselwörter sind kann man denn Parser recht einfach halten. Ich denke aber nicht das es da einen zwingenden Grund gab es so zu machen jenseits von "Keep it simple" aus Compiler/Parser Sicht. Im Umfeld der "special classes" wird man wohl mehrere so Merkwürdigkeiten finden können.
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 28.04.17 16:48 
- Nachträglich durch die Entwickler-Ecke gelöscht -