Hi all,

Last week posted a patch for a review [1], which uses case ranges. Case ranges 
make switch statements more concise, an example would be

switch (var) {
  case 1 ... 3:
     break;
}

Without case ranges, we would either need to use if statements or multiple case 
statements if the range is reasonably small.

There are more places where we seem to use them and in my opinion they can 
potentially make switch statements a lot more powerful. However they are not 
part of the C++ standard, they are a GNU extension [2] which is also supported 
by clang. What is the general feeling towards accepting them?

[1]: https://gem5-review.googlesource.com/#/c/2280/
[2]: https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html

Regards,

Nikos


IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to