[Tfug] Developer question

Robert Hunter hunter at tfug.org
Fri Jul 6 17:12:59 MST 2007


On 7/6/07, Bexley Hall <bexley401 at yahoo.com> wrote:
> > enum color_t {
> >        /* must begin with 0, so sayeth the standard
>
> Actualy, that's just the example context... you can
> begin with damn near *anything*!  :>

Yes, I realized as soon as I sent that email that there was a potential
misunderstanding.  What I *meant* to say is that in the absence of an
explicit specifier, enum begins with zero.

> Obviously, I don't trust people to dot i's and cross t's

The difficulty, as I see it, is that you are trying to prevent an intent
error using syntactic mechanisms.  Strictly speaking, it is impossible to
do this, although you may be able to make it blindingly obvious how your
code should be handled by other developers.

-- 
Rob




More information about the tfug mailing list