[Issue 9065] Please consider adding these std.traits

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 28 06:39:19 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9065



--- Comment #48 from Don <clugdbug at yahoo.com.au> 2012-11-28 06:39:16 PST ---
(In reply to comment #47)
> (In reply to comment #46)
> > (In reply to comment #45)
> > > interested in knowing exactly how it is not like an enum, not internally, not
> > > historically, but in terms of usage from a programmers POV?
> > 
> > It doesn't enumerate anything? Enumerations are collections of items, aren't
> > they? How is one element a collection?
> 
> Then you need to disallow assigning explicit values to enum keys, that's not
> strictly an enumeration either.
> It just so happens that anonymous enums containing only a single value have a
> nice little sugar such that you don't need to write the brackets. This is
> because, in practise, this turns out to be a surprisingly common usage case so
> the little sugar is nice.

I believe the similarity you've listed is false. An enumerated type must be
integral (it must be countable!) A manifest constant, however, can be anything
- a struct literal, for example.

I think what has happened is that C had a very sloppy enum design, where it
mixed integral manifest constants with enumerated types. Instead of tightening
up 'enum', we used the existing sloppiness as an excuse to make it worse.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list