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