Add std::vector copy constructor to proxy
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11233 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f3a70a1a03
commit
7841adc675
2 changed files with 9 additions and 1 deletions
|
|
@ -153,7 +153,7 @@ public class li_std_vector_runme {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
new DoubleVector(null);
|
new DoubleVector((System.Collections.ICollection)null);
|
||||||
throw new Exception("ICollection constructor null test failed");
|
throw new Exception("ICollection constructor null test failed");
|
||||||
} catch (ArgumentNullException) {
|
} catch (ArgumentNullException) {
|
||||||
}
|
}
|
||||||
|
|
@ -180,6 +180,13 @@ public class li_std_vector_runme {
|
||||||
throw new Exception("LastIndexOf non-existent test failed");
|
throw new Exception("LastIndexOf non-existent test failed");
|
||||||
if (dv.LastIndexOf(33.3) != 6)
|
if (dv.LastIndexOf(33.3) != 6)
|
||||||
throw new Exception("LastIndexOf position test failed");
|
throw new Exception("LastIndexOf position test failed");
|
||||||
|
|
||||||
|
// Copy constructor test
|
||||||
|
DoubleVector dvCopy = new DoubleVector(dv);
|
||||||
|
for (int i=0; i<doubleArray.Length; i++) {
|
||||||
|
if (doubleArray[i] != dvCopy[i])
|
||||||
|
throw new Exception("Copy constructor failed, index:" + i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Repeat() test
|
// Repeat() test
|
||||||
|
|
|
||||||
|
|
@ -226,6 +226,7 @@
|
||||||
%newobject GetRange(int index, int count);
|
%newobject GetRange(int index, int count);
|
||||||
%newobject Repeat(const value_type& value, int count);
|
%newobject Repeat(const value_type& value, int count);
|
||||||
vector();
|
vector();
|
||||||
|
vector(const vector &other);
|
||||||
%extend {
|
%extend {
|
||||||
vector(int capacity) throw (std::out_of_range) {
|
vector(int capacity) throw (std::out_of_range) {
|
||||||
std::vector<CTYPE >* pv = 0;
|
std::vector<CTYPE >* pv = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue