From post@volker-wysk.de Fri Nov  2 21:47:59 2001
Received: from volker (mail@dsl-213-023-038-015.arcor-ip.net [213.23.38.15])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id fA2Klxt15176
	for <prolog@swi.psy.uva.nl>; Fri, 2 Nov 2001 21:47:59 +0100 (MET)
Received: from v by volker with local (Exim 3.22 #1 (Debian))
	id 15zlDB-0001K7-00
	for <prolog@swi.psy.uva.nl>; Fri, 02 Nov 2001 21:46:45 +0100
Date: Fri, 2 Nov 2001 21:46:44 +0100
From: Volker Wysk <post@volker-wysk.de>
To: prolog@swi.psy.uva.nl
Message-ID: <20011102214644.A5074@volker>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Mailer: Balsa 1.1.6
Lines: 16
Sender: Volker Wysk <post@volker-wysk.de>
Subject: [SWIPL] no copy semantics for PlTerm, in the C++ interface

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

