swig/Examples/test-suite/cpp0x_result_of.i
Matevz Jekovec bc8f86b6ec Fixed cpp0x_result_of testcase.
Added testcase cpp0x_sizeof_object.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@11538 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-12 10:18:18 +00:00

20 lines
505 B
OpenEdge ABL

/* This testcase checks whether Swig correctly uses the new result_of class
and its templating capabilities introduced in C++0x. */
%module cpp0x_result_of
%inline %{
#include <functional>
#include <iostream>
double square(double x) {
return (x * x);
}
template<class Fun, class Arg>
typename std::result_of<Fun(Arg)>::type test_result_impl(Fun fun, Arg arg) {
return fun(arg);
}
%}
%template(test_result) test_result_impl<double(*)(double), double>;
%constant double (*SQUARE)(double) = square;