You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rationale: If a PlFrame object is passed by value, the implicity generated copy constructor creates another PlFrame that holds the same fid value. We now have two references to the same prolog frame with different lifetimes, and when one is destroyed, the fid attribute of the other points to a frame that has already been closed. Correct me if I'm wrong, but that does not seem be intended.
The text was updated successfully, but these errors were encountered:
vmatare
changed the title
PlFrame should be non-copyable
PlFrame should be non-copyable
May 15, 2016
I've added "delete"d definitions for assignment and copy constructor. I've also gone through the other classes and made explicit whether they are copyable or not.
In general, I've disabled the assignment operators because of conflict with the definition of unification; and I've also removed the assignment for PlTerm, which implemented unification because it (a) could be confusing, (b) made it easy to leave off the test for success, and (c) has different semantics than what people expect with assignment (returning a bool instead of a reference to the left hand side).
These changes should be available within a few days.
Rationale: If a
PlFrame
object is passed by value, the implicity generated copy constructor creates anotherPlFrame
that holds the samefid
value. We now have two references to the same prolog frame with different lifetimes, and when one is destroyed, thefid
attribute of the other points to a frame that has already been closed. Correct me if I'm wrong, but that does not seem be intended.The text was updated successfully, but these errors were encountered: