use inplace +=

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5860 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-04-09 21:59:38 +00:00
commit c6f9abd8f4

View file

@ -217,18 +217,11 @@ namespace std {
replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2);
#endif
std::basic_string<_CharT>& operator +=(const basic_string& v);
%newobject __iadd__;
%newobject __add__;
%newobject __radd__;
%extend {
/*
swig workaround. if used as expected, __iadd__ deletes 'self'.
*/
std::basic_string<_CharT>* __iadd__(const basic_string& v) {
*self += v;
return new std::basic_string<_CharT>(*self);
}
std::basic_string<_CharT>* __add__(const basic_string& v) {
std::basic_string<_CharT>* res = new std::basic_string<_CharT>(*self);