Skip to content

How to overload the assignment operator?

2 messages · Jens Oehlschlägel, Brian Ripley

#
Thank you Brian,
So I understand that setReplaceMethod will not help.
I would be even happier if the cloning would only occur on any attempt to change the external pointer / proxy-object.
Mh, unless the internal copying mechanism would call a clone generic for non-atomic objects
How that? How do I know that any user has assigned/modified the external pointer (or a proxy object containing the external pointer) such that I can invoke the cloning?

Best regards


Jens Oehlschl?gel
--
#
On Tue, 13 Nov 2007, "Jens Oehlschl?gel" wrote:

            
But as I said, there is no provision for that.  Nor is there going to be. 
One reason is performance, as Simon has hinted.  Another is consistency: 
duplication might well be called from places where class is being ignored.
I don't even know what you want to do.  But I don't think copying is the 
place to find out if a user changed an object: presumably it was done via 
your interface.