diff --git a/SWIG/Lib/ruby/std_vector.i b/SWIG/Lib/ruby/std_vector.i index 2009c3282..f3570a2ba 100644 --- a/SWIG/Lib/ruby/std_vector.i +++ b/SWIG/Lib/ruby/std_vector.i @@ -314,7 +314,7 @@ namespace std { } public: vector(unsigned int size = 0); - vector(unsigned int size, const T* value); + vector(unsigned int size, T * &value); vector(const vector &); %rename(__len__) size; @@ -323,7 +323,7 @@ namespace std { bool empty() const; void clear(); %rename(push) push_back; - void push_back(const T* x); + void push_back(T* x); %extend { T* pop() { if (self->size() == 0) @@ -340,7 +340,7 @@ namespace std { else throw std::out_of_range("vector index out of range"); } - void __setitem__(int i, const T* x) { + void __setitem__(int i, T* x) { int size = int(self->size()); if (i<0) i+= size; if (i>=0 && isize(); i++) { - T* x = &((*self)[i]); + T* x = (*self)[i]; rb_yield(SWIG_NewPointerObj((void *) x, $descriptor(T *), 0)); }