From: Russell E. Owen <rowen@uw...> - 2009-10-29 18:00:20
I am having some issues with shadowed constructors that I think are
caused by using std_vector.i
Some of our classes have multiple constructors such as this:
Foo::Foo(std::vector<boost::shared_ptr<FancyClass> > &fancyClasses)
and our SWIG file wraps the class Foo and also wraps the arguments as so:
SWIG complains that the latter constructor is shadowed by the former.
As far as I can tell this is because both std::vector<double> and
std::vector<boost::shared_ptr<some fancyclass> > have been templated
after including std_vector.i. Thus SWIG is trying to support all of the
following forms of Foo constructor:
1) an explicitly constructed VectorDouble
2) a python list of doubles (due to std_vector.i and much appreciated)
3) an explicitly constructed VectorFancyClass
4) a python list of FancyClasses (due to std_vector.i and not necessary)
and the two python list versions (2 and 4) are colliding with each other.
I suspect that both Foo constructors are actually available, and that
only case (4) is unavailable. If so, we can live with it. But I would
rather explicitly disable std_vector.i for VectorFancyClass if there is
some easy way to do this.
I realize I could just include std_vector.i at the very end, but that
happens to be a headache due to the way we're including it right now (in
a common .i file shared by all others -- maybe that is a mistake).