enums_with_header.h 429 B

1234567891011121314151617181920212223
  1. #pragma once
  2. enum EWithHeader {
  3. HOne /* "one" */,
  4. HTwo,
  5. HThree,
  6. };
  7. constexpr unsigned EvalValue(unsigned r, unsigned d) {
  8. while (r >= 50) {
  9. r *= d;
  10. }
  11. return r;
  12. }
  13. // enumeration with values that depend on the preprocessor, architecture and constexpr function evaluation
  14. enum class ENontrivialValues {
  15. A = __LINE__,
  16. B = EvalValue(1522858842, 13),
  17. C,
  18. D = sizeof(int*[A][C]),
  19. };