From 769bd6a5a5e39b7d93c75025347b8aad88459ca0 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 30 Dec 2005 00:17:19 +0000 Subject: [PATCH] add copyctor git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8130 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/CHANGES.current b/CHANGES.current index a2103cc07..1bd0f65b0 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,58 @@ Version 1.3.28 (unreleased). =========================== + +12/29/2005: mmatus + - Add the copyctor feature/directive to enable the automatic + generation of copy constructors. Use as in: + + %copyctor A; + + struct A { + + }; + + then this will work + + a1 = A(); + a2 = A(a1); + + Also, since is a feature, if you type just + + %copyctor; + + that will enable the automatic generation for all the + classes. That is also equivalent to + + swig -features copyctor -c++ ... + + Notes: + + 1.- The feature only works in C++ mode. + + 2.- The automatic creation of the copy constructor will + usually produce overloading. Hence, if the target + language doesn't support overloading, a special name + will be used (A_copy). + + 3.- For the same above, probably is not a good idea to + use the flag when, for example, in python if you are + using keywords. + + 4.- The copyctor automatic mechanism follows more or less + the same rules than the default constructor mechanism, + i.e., a copy constructor will not be added if the + class is abstract or if there is a pertinent non-public + copy ctor in the class or its hierarchy. + + Hence, it could be necessary for you to complete the + class declaration with the proper non-public copy ctor + to avoid a wrong constructor addition. + + - Fix features/rename for templates ctor/dtor and other + things around while adding the copyctor mechanism. + + 12/27/2005: mmatus - Add the 'math' option to typemaps. Assume you have: