enum : bool

Tower Ty towerty at msn.com.au
Fri Jun 13 13:04:25 PDT 2008


Jarrett Billingsley Wrote:

> "BCS" <ao at pathlink.com> wrote in message 
> news:55391cb32e20b8ca9ab3c6527b36 at news.digitalmars.com...
> >
> > This works
> >
> > enum Test : bool
> > {
> > yes = true,
> > no = false
> > }
> >
> > void TestIt(Test);
> >
> > TestIt(Test.yes);
> >
> >
> > Is any one makeing use of it? It allows for more usefull nameing.
> 
> Would've been funny if
> 
> enum MyBool : bool
> {
>     True,
>     False,
>     FileNotFound
> }
> 
> worked but alas, the compiler (shockingly!) isn't buggy and errors on the 
> overflow.. 
> 
> 
Ok fellas so is there anything I can learn here?
Can I put this to use somehow ?
Is it showing a correct function or an incorrect one?
More detail please.


More information about the Digitalmars-d-learn mailing list