-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Service Arch
As a GCC extension, you can write 'case ranges' in switch statements, e.g.
switch (x) { case 1 ... 5: // etc }
It would be nice if we had a macro which allows us to use this extension. When the compiler supports the extension, it can use the syntax above, and when the compiler does not support it, it could expand to a series of 'case' labels.
switch (x) { MONGO_CASE_RANGE(kSomethingMin, kSomethingMax): // etc }