home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 33,235 of 33,346   
   =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All   
   Re: max enum value +1   
   06 Oct 13 16:34:18   
   
   From: daniel.kruegler@googlemail.com   
      
   Am 06.10.2013 21:26, schrieb fmatthew5876:   
   >> It would anyway have to handle this case:   
   >>   
   >> Color white = red|green|blue;   
   >   
   > This fails to compile because (red | green | blue) is of type int, not   
   > Color. You need a cast to do this.   
      
   Yet still the problem described by Bo Persson does exist: It is OK to   
   define enumeration values "out-of-line" such that they would have an   
   underlying value that does not exist in any of the enumerators of the   
   enumeration definition provided it is within the required limits denoted   
   as "b_min" and "b_max" in 7.2 [dcl.enum] p8. Such values can  be even   
   larger or smaller than the underlying values of the smallest or largest   
   enumerators (within the other constraints provided by [dcl.enum]).   
      
   Greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca