fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Foo
  5. {
  6. int _value;
  7.  
  8. public:
  9. // Запрещаем копирование и перемещение, объявив хотя бы один конструктор вручную
  10. Foo()
  11. : _value(rand())
  12. {
  13. }
  14.  
  15. // ... ещё много-много методов
  16.  
  17. int bar() const
  18. {
  19. return _value;
  20. }
  21. };
  22. int main() {
  23. // your code goes here
  24. Foo a=Foo();
  25. Foo b=a;
  26.  
  27. return 0;
  28.  
  29. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty