Re: C++0x strongly typed enums

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



as far as i know things inside enum are placed in the same scope where
you put enum itself. this example compiles fine:

enum{
 CONST_1=1, CONST_2=2 // global scope
};

int main(){
  int x=CONST_1+CONST_2;
  return 0;
}

i use enums with structures like this:

struct options{
  enum{
    opt_1,opt_2,opt_3
  };
};

...

int x=options::opt_1+options::opt_2;

regards,
jay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux