swig/Examples/test-suite/template_specialization.i
Marcelo Matus 4bf191197f fix warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5629 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-13 02:52:25 +00:00

37 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>;
}