test.cpp 412 B

12345678910111213141516171819202122
  1. #define _STR(x) #x
  2. #define STR(x) _STR(x)
  3. enum vocalization
  4. {
  5. meow, // tame cat
  6. roar, // wild cat
  7. whine, // tame dog
  8. growl // wild dog
  9. };
  10. #if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
  11. static_assert(NOISE == EXPECTED,
  12. "expected " STR(EXPECTED) ", got " STR(NOISE));
  13. #else
  14. typedef int test[(NOISE == EXPECTED) ? 1 : -1];
  15. #endif
  16. int main()
  17. {
  18. return 0;
  19. }