Files
cpp-thirdparty/winx64/bin/swig-3.0.12/Examples/test-suite/template_specialization.i
Bassem Girgis 81b4b9e273 Initial commit
2018-12-20 17:34:07 -06:00

38 lines
691 B
OpenEdge ABL

%module template_specialization
%rename(not1) *::operator!() const;
%rename(negate) *::operator-() const;
%inline %{
namespace vfncs {
template <class ArgType>
struct UnaryFunction
{
UnaryFunction operator-() const { return *this; }
};
template <>
struct UnaryFunction<bool>
{
// This works
// UnaryFunction<bool> operator!() const;
// This doesn't
UnaryFunction operator!() const { return *this; }
// Does this?
void foo(UnaryFunction) { }
};
}
%}
namespace vfncs {
%template(UnaryFunction_double) UnaryFunction<double>;
%template(UnaryFunction_bool) UnaryFunction<bool>;
}