fork download
  1. namespace flags {
  2. constexpr int a=1,
  3. b=1<<1,
  4. c=1<<2
  5. ;
  6. }
  7.  
  8. int main() {
  9. auto a=flags::a | flags::b;
  10. //These can be compile operations too!
  11. static_assert(flags::a | flags::b==3, "");
  12. }
Success #stdin #stdout 0s 2924KB
stdin
Standard input is empty
stdout
Standard output is empty