packages-cpp
packages-cpp copied to clipboard
PlFrame should be non-copyable
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.
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.