swig/Examples/test-suite/nested_in_template.i
Zackery Spytz a0b84f5180 Fix some MSVC compiler warnings in the test suite
nested_in_template_wrap.cxx(247): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
python_pybuffer_wrap.cxx(2788): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
Modules\python.cxx(2227) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
2019-03-07 09:44:01 -07:00

34 lines
681 B
OpenEdge ABL

%module nested_in_template
#if !defined(SWIGCSHARP) && !defined(SWIGJAVA)
%feature("flatnested");
#endif
%inline %{
template <int>
struct OuterTemplate;
template <>
struct OuterTemplate<1>
{
struct AbstractBase
{
virtual bool IsSameAs(const AbstractBase& other) const = 0;
virtual ~AbstractBase() {}
};
struct ConcreteDerived : AbstractBase
{
ConcreteDerived() : m_value(0) {}
explicit ConcreteDerived(int value) : m_value(value) {}
virtual bool IsSameAs(const AbstractBase& other) const {
return m_value == static_cast<const ConcreteDerived&>(other).m_value;
}
int m_value;
};
};
%}
%template(OuterTemplate1) OuterTemplate<1>;