Fix compile error when using directors
Fix when using templates with more than one template parameter and used as an input parameter in a virtual method in a director class (problem affecting most of the scripting languages). Fixes #2160
This commit is contained in:
parent
0239ba5536
commit
2268d6ee96
5 changed files with 36 additions and 2 deletions
|
|
@ -216,6 +216,7 @@ CPP_TEST_CASES += \
|
|||
director_ref \
|
||||
director_simple \
|
||||
director_smartptr \
|
||||
director_template \
|
||||
director_thread \
|
||||
director_unroll \
|
||||
director_unwrap_result \
|
||||
|
|
|
|||
28
Examples/test-suite/director_template.i
Normal file
28
Examples/test-suite/director_template.i
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
%module(directors="1") director_template
|
||||
|
||||
%{
|
||||
#include <vector>
|
||||
%}
|
||||
|
||||
%include <std_vector.i>
|
||||
|
||||
%feature("director") HandleBytes;
|
||||
|
||||
%inline %{
|
||||
template <typename X, typename Y> class TwoTemplateParms {};
|
||||
%}
|
||||
|
||||
%template(TT_int_double) TwoTemplateParms<int, double>;
|
||||
|
||||
%inline %{
|
||||
class HandleBytes {
|
||||
public:
|
||||
virtual void handle(const std::vector<unsigned char> data) = 0; // Note: not instantiated with %template
|
||||
virtual void handle2(TwoTemplateParms<int, double> data) = 0;
|
||||
virtual ~HandleBytes() {}
|
||||
};
|
||||
|
||||
void bytes_wrapper(const std::vector<unsigned char> data, HandleBytes *handler) {
|
||||
handler->handle(data);
|
||||
}
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue