Serge Ratke
unread,Mar 17, 2012, 1:37:46 PM3/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to swig...@lists.sourceforge.net
hey guys,
i'm having a hard time figuring out how to make swig understand which function
to use:
// module.i
%include "stl.i"
%include "std_string.i"
%include "std_vector.i"
template<class T>
class GenericState : public State {
public:
GenericState( const string& );
GenericState( const string&, T );
~GenericState();
T value() const;
};
template<class T>
class GenericState<vector<T> > : public State {
public:
GenericState( const string& );
GenericState( const string&, vector<T> );
~GenericState();
T value( const s32 ) const;
};
%template(StateInt) GenericState<int>;
%template(StateString) GenericState<string>;
%template(StateIntVector) GenericState<vector<int> >;
// error message
Error: no matching function to call »GenericState<std::vector<int> >::value()
const«
candidate is: T GenericState<std::vector<_RealType> >::value(int) const [with
T = int, s32 = unsigned int]
the generated wraper code for StateIntVector calls the function value() where
value(const s32) should have been called.
cheers