fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. #define PARAM_A_VAL_0 0
  6. #define PARAM_A_VAL_1 1
  7. bool external_function_param_a(int param_a) {
  8. cout << param_a << endl;
  9. }
  10. struct wrapper
  11. {
  12. class PARAM_A {
  13. int val;
  14. PARAM_A(int val) : val(val) {}
  15. friend class ::wrapper;
  16. public:
  17. static const PARAM_A VAL_0;
  18. static const PARAM_A VAL_1;
  19. };
  20. bool SetParamA(wrapper::PARAM_A a);
  21. };
  22.  
  23.  
  24. const wrapper::PARAM_A wrapper::PARAM_A::VAL_0 = wrapper::PARAM_A(PARAM_A_VAL_0);
  25. const wrapper::PARAM_A wrapper::PARAM_A::VAL_1 = wrapper::PARAM_A(PARAM_A_VAL_1);
  26.  
  27. bool wrapper::SetParamA(wrapper::PARAM_A a)
  28. {
  29. return external_function_param_a(a.val);
  30. }
  31.  
  32. int main() {
  33. wrapper w;
  34. w.SetParamA(wrapper::PARAM_A::VAL_0);
  35. w.SetParamA(wrapper::PARAM_A::VAL_1);
  36. return 0;
  37. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
0
1