fix feautures + qual + templates

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6578 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-11-01 18:14:52 +00:00
commit d6e3a92182
2 changed files with 89 additions and 21 deletions

View file

@ -68,3 +68,60 @@ public:
%template(TemplateInt) Template<int>;
%newobject One::getSquare() const;
%inline %{
struct Square
{
Square(int)
{
}
};
struct One {
Square *getSquare() const { return new Square(10); }
};
%}
%newobject Two::getSquare();
%inline %{
struct Two {
Square *getSquare() const { return new Square(10); }
};
char *foo() {return 0;}
%}
%exception {
// default %exception
}
%exception std::Vector::get {
// get %exception
}
%inline %{
namespace std {
template<class T> class Vector {
public:
void push_back(const T& x) {}
#ifdef SWIG
%extend {
T& get(int i) {
throw std::out_of_range("Vector index out of range");
}
}
#endif
};
}
%}
%template(VectorInt) std::Vector<int>;