diff --git a/Lib/csharp/std_vector.i b/Lib/csharp/std_vector.i index 0d1476f7f..95543c2fa 100644 --- a/Lib/csharp/std_vector.i +++ b/Lib/csharp/std_vector.i @@ -114,6 +114,12 @@ array.SetValue(getitemcopy(index+i), arrayIndex+i); } + public $typemap(cstype, CTYPE)[] ToArray() { + $typemap(cstype, CTYPE)[] array = new $typemap(cstype, CTYPE)[Count]; + this.CopyTo(array); + return array; + } + global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { return new $csclassnameEnumerator(this); }