swig/Examples/test-suite/template_specialization.i
William S Fulton 60ea8877de warning removal for C#
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4584 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-19 23:03:27 +00:00

40 lines
747 B
OpenEdge ABL

%module template_specialization
%rename(__not__) *::operator!() const;
#if defined(SWIGJAVA) || defined(SWIGCSHARP)
%rename(negate) *::operator-() const;
#endif
%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>;
}