|
From: Jason T. <lef...@gm...> - 2009-04-10 16:59:18
|
The follow simple test case always generates C# wrappers which are
invalid and uncompileable. The bug exists at least from 1.3.36 to
1.3.39. I feel like I must be doing something wrong, but every other
language I have tried works, just not C#.
//test.i
%module TestCSharp
%include "test.h"
%include <std_vector.i>
%template(TestVec) std::vector<test::Test>;
//test.h
#include <vector>
namespace test
{
class Test
{
};
class Test2
{
public:
std::vector<Test> get_some_tests();
};
}
//Offending output from TestVec.cs
public TestVec(System.Collections.ICollection c) : this() {
if (c == null)
throw new ArgumentNullException("c");
foreach (test::Test element in c) {
this.Add(element);
}
}
public test::Test this[int index] {
get {
return getitem(index);
}
set {
setitem(index, value);
}
}
test::Test is not valid C# and the C# compiler fails on it.
There are more or less instances of the C++ namespace (test::) being
injected in the C# output depending on the version of SWIG used.
Thank you for any help you can provide.
-Jason
--
http://emptycrate.com Games, Programming, Travel & other stuff
|