Fix template_empty_inherit testcase
- To be standards compliant - Wrap operator() for all target languages
This commit is contained in:
parent
aedc3c3eaf
commit
b2660e7100
1 changed files with 3 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
%module template_empty_inherit
|
||||
|
||||
%rename(FunctorOperator) operator();
|
||||
|
||||
%inline %{
|
||||
template<class Arg, typename Result> struct Functor {
|
||||
virtual Result operator()(Arg x) const = 0;
|
||||
|
|
@ -13,6 +15,7 @@ template<class Arg, typename Result> struct Functor {
|
|||
|
||||
%inline %{
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
struct SquareFunctor : Functor<int, int> {
|
||||
int operator()(int v) const { return v*v; }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue