add copyctor

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8130 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-30 00:17:19 +00:00
commit a9111581bd

View file

@ -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: