fix copyctor + template bug #1432125
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8820 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
88cf71c939
commit
88023f8b82
3 changed files with 43 additions and 1 deletions
|
|
@ -93,6 +93,7 @@ CPP_TEST_CASES += \
|
|||
const_const_2 \
|
||||
constant_pointers \
|
||||
constover \
|
||||
constructor_copy \
|
||||
constructor_exception \
|
||||
constructor_explicit \
|
||||
constructor_value \
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
%module constructor_copy
|
||||
|
||||
%copyctor;
|
||||
%nocopyctor Foo8;
|
||||
%nocopyctor Bar<double>;
|
||||
|
||||
|
|
@ -67,3 +68,42 @@ public:
|
|||
%template(Bard) Bar<double>;
|
||||
|
||||
|
||||
|
||||
%{
|
||||
#include <vector>
|
||||
%}
|
||||
|
||||
namespace std {
|
||||
|
||||
template<class T> class vector {
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef T value_type;
|
||||
typedef const value_type& const_reference;
|
||||
vector();
|
||||
vector(size_type n);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
%copyctor;
|
||||
|
||||
//%ignore std::vector<Space::Flow>::vector(size_type);
|
||||
%ignore std::vector<Space::Flow>::resize(size_type);
|
||||
//Ignore as Flow does not have a default constructor
|
||||
|
||||
%inline %{
|
||||
|
||||
namespace Space {
|
||||
class Flow {
|
||||
public:
|
||||
Flow() {}
|
||||
Flow(int i) {}
|
||||
Flow(const Flow& other) {}
|
||||
};
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%template (VectFlow) std::vector<Space::Flow>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue