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,229 of 33,346    |
|    Seungbeom Kim to All    |
|    Re: max enum value +1    |
|    05 Oct 13 04:40:27    |
   
   From: musiphil@bawi.org   
      
   On 2013-10-03 23:59, fmatthew5876 wrote:   
   >   
   > It would be great if there was just some way to get the max count +1 of   
   > any enum.   
   > Something like:   
   >   
   > enum Color {   
   > kRed,   
   > kBlue,   
   > kGreen   
   > };   
   > constexpr int kNumColors = std:enum_bound(Color);   
      
   The syntax has to be different unless enum_bound becomes a keyword,   
   because Color is a type.   
      
   It would be great if the compiler generates something like this   
   automatically:   
      
   namespace std {   
      
   template
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca