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
|
%module template_empty_inherit
|
||||||
|
|
||||||
|
%rename(FunctorOperator) operator();
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
template<class Arg, typename Result> struct Functor {
|
template<class Arg, typename Result> struct Functor {
|
||||||
virtual Result operator()(Arg x) const = 0;
|
virtual Result operator()(Arg x) const = 0;
|
||||||
|
|
@ -13,6 +15,7 @@ template<class Arg, typename Result> struct Functor {
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <iterator>
|
||||||
struct SquareFunctor : Functor<int, int> {
|
struct SquareFunctor : Functor<int, int> {
|
||||||
int operator()(int v) const { return v*v; }
|
int operator()(int v) const { return v*v; }
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue