fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct vector2d {
  5.  
  6. vector2d(float y, float x) : y(y), x(x) {}
  7. vector2d() : y(-1), x(0) {}
  8.  
  9. float y, x;
  10. };
  11.  
  12. class Foo {
  13.  
  14. public:
  15. Foo() {
  16. acceleration_force = vector2d();
  17. //acceleration_force(); не видит конструктора вообще
  18. std::cout << "acc x: " << acceleration_force.x << " y: " << acceleration_force.y << std::endl;
  19. }
  20. private:
  21. vector2d acceleration_force;
  22. };
  23.  
  24. int main() {
  25. std::cout << "begin" << std::endl;
  26. Foo foo = Foo();
  27. return 0;
  28. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
begin
acc x: 0 y: -1