fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. class APD
  6. {
  7. public:
  8. APD();
  9. enum Matched{yet_not_matched,already_matched};
  10. Matched getmatch() const;
  11. void setmatch(Matched a_matched);
  12.  
  13. private:
  14. Matched m_matched;
  15. };
  16.  
  17. APD::APD()
  18. {
  19. m_matched=yet_not_matched;
  20. }
  21.  
  22.  
  23. APD::Matched APD::getmatch() const
  24. {
  25. return m_matched;
  26. }
  27.  
  28. void APD::setmatch(Matched a_matched)
  29. {
  30. m_matched=a_matched;
  31. }
  32.  
  33. int main()
  34. {
  35. vector<APD> apdvec;
  36. APD apd;
  37. apdvec.push_back(apd);
  38. for(unsigned long int i=0;i<apdvec.size();i++)
  39. {
  40. int matched_i = apdvec[i].getmatch();
  41. cout << matched_i << '\n';
  42. }
  43. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
0