Hi,
I have a problem wrapping a template class whose member functions have
default values that are objects of a template type... well, what I mean
is best shown on an example:
class A
{
public:
int v;
};
template<class T>
class B
{
T value;
public:
B(T a=T()) : value(a) {}
void foo(T a=T()) {}
};
inline void instantiation()
{
B<A> b;
}
When I create bindings for classes A and B, Py++ produces source code
that doesn't compile.
The problem is the default value in the constructor of B and the foo()
method. The values are instances of template class T which should be A
in the above example. But Py++ actually writes "T()" into the source
code which, of course, is not declared and produces a compile error.
I suppose in a case like this Py++ should recognize that the expression
for the default value uses a template type and replace it with the
actual type that was used in the instantiation.
I don't know if this is easy to do, but I could imagine that it is not
quite trivial...
So what do you think, could Py++ handle this all alone or do I have to
replace the default value myself somehow?
Cheers,
- Matthias -
|