fork(1) download
  1. #include <iostream>
  2.  
  3. #define property(T, x) private : T m_## x; \
  4. public : T get_## x () { return m_## x;} \
  5. void set_## x (T value) { m_## x = value; }
  6.  
  7. class foo {
  8. public:
  9. property(int, count);
  10. property(float, size);
  11. };
  12.  
  13. int main() {
  14. foo f;
  15. f.set_count(10);
  16. std::cout << f.get_count() << std::endl;
  17. return 0;
  18. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
10