git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4584 626c5289-ae23-0410-ae9c-e8d60b6d4f22
40 lines
747 B
OpenEdge ABL
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>;
|
|
}
|