I get double sections for the distance between 2 squares ( B
2 objects) I am using C
which are the sub-classes of the second (A) I think that the methods in the class A
should be instantaneous, so I can not make them pure virtual, okay?
One more thing is that I am not sure if I am using a well-dual transmission, because sometimes an infinite loop is generated, in definition (< Double Double (B * B) {return std :: numeric_limits & lt; double} in A>
& Gt; :: Maximum ();} Virtual Double Distance B (C * C) {A- Virtual Double Distance C (C * C) {return std} Virtual Double Distance (C * C) Return
in class B
:
In class C
:
Double C :: Distance (A * A) {return-> DistanceC (this);} Double C :: Distance B (B * B) {/ * Calculation Distance: Double} Double C: : Distance C (C * C) {/ * Calculation Distance * /}
< Code> virtual Force distance (A * A) {return A-> Distance (this);}
So if I have:
A * A1, A 2;
And I call:
a1-> Distance (A2);
will call the above implementation
a2-> Distance (A1);
who will call:
a1-> Distance (A2);
... and this is an infinite loop.
Comments
Post a Comment