fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct test
  5. {
  6. static const int one = 1;
  7. enum { two = 2 };
  8. };
  9.  
  10. void printint(const int & i)
  11. {
  12. cout << i << endl;
  13. }
  14.  
  15. void printint2(const int i)
  16. {
  17. cout << i << endl;
  18. }
  19.  
  20. int main() {
  21. //printint(test::one); // error
  22. printint2(test::one); // no error
  23. printint(test::two); // no error
  24. printint2(test::two); // no error
  25. return 0;
  26. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1
2
2