Subject: [SWIPL] no copy semantics for PlTerm, in the C++ interface

From: Volker Wysk <[email-masked]>
Date: Fri, 2 Nov 2001 21:46:44 +0100

Hi 

The class PlTerm in the C++ interface, SWI-cpp.h, contains this:

  int operator =(const PlTerm &t2)	/* term */
  { return PL_unify(ref, t2.ref);
  }

This is not correct copy semantics. You can't overwrite a PlTerm 
object. You can't use PlTerm objects as values like this. For 
instance, the Standard Template Library relies on correct copy 
semantics. You couldn't store PlTerm's in STL containers, etc.

I suggest renaming the operator=() methods to unify().

Volker