Hi everybody. I wonder if in C++ or Qt there is some simple way to check if an int equals to some int from a predefined list. I mean something like pseudo code below. Much thanks.
Qt Code:
  1. int a = 3;
  2. int b = 8;
  3. int c = 20;
  4.  
  5. int x = 5;
  6.  
  7. if (x in [a,b,c]) {
  8. //further processing
  9. }
  10.  
  11. if (x in [2,7,5]) {
  12. //further processing
  13. }
To copy to clipboard, switch view to plain text mode