Allow objects to be modified during iteration (and minor method name change)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4246 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3e5a5404ce
commit
7a8f71fa7c
1 changed files with 2 additions and 4 deletions
|
|
@ -175,7 +175,6 @@ namespace std {
|
|||
unsigned int size() const;
|
||||
%rename("empty?") empty;
|
||||
bool empty() const;
|
||||
%rename("clear!") clear;
|
||||
void clear();
|
||||
%rename(push) push_back;
|
||||
void push_back(const T& x);
|
||||
|
|
@ -206,8 +205,8 @@ namespace std {
|
|||
void each() {
|
||||
swig_type_info* type = SWIG_TypeQuery(#T " *");
|
||||
for (unsigned int i=0; i<self->size(); i++) {
|
||||
T* x = new T((*self)[i]);
|
||||
rb_yield(SWIG_NewPointerObj((void *) x, type, 1));
|
||||
T* x = &((*self)[i]);
|
||||
rb_yield(SWIG_NewPointerObj((void *) x, type, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -322,7 +321,6 @@ namespace std {
|
|||
unsigned int size() const;
|
||||
%rename("empty?") empty;
|
||||
bool empty() const;
|
||||
%rename("clear!") clear;
|
||||
void clear();
|
||||
%rename(push) push_back;
|
||||
void push_back(T x);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue