The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6fcc22a1f8
commit
516036631c
1508 changed files with 125983 additions and 44037 deletions
50
SWIG/Examples/test-suite/template_int_const.i
Normal file
50
SWIG/Examples/test-suite/template_int_const.i
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
%module template_int_const
|
||||
|
||||
%warnfilter(801) interface_traits; /* Ruby, wrong class name */
|
||||
%warnfilter(801) module_traits; /* Ruby, wrong class name */
|
||||
|
||||
%inline %{
|
||||
enum Polarization { UnaryPolarization, BinaryPolarization };
|
||||
struct interface_traits
|
||||
{
|
||||
static const Polarization polarization = UnaryPolarization;
|
||||
};
|
||||
template <Polarization P>
|
||||
struct Interface
|
||||
{
|
||||
};
|
||||
|
||||
typedef unsigned int Category;
|
||||
struct module_traits
|
||||
{
|
||||
static const Category category = 1;
|
||||
};
|
||||
|
||||
template <Category C>
|
||||
struct Module
|
||||
{
|
||||
};
|
||||
%}
|
||||
|
||||
%template(Interface_UP) Interface<UnaryPolarization>;
|
||||
%template(Module_1) Module<1>;
|
||||
|
||||
%inline %{
|
||||
struct ExtInterface1 :
|
||||
Interface<UnaryPolarization> // works
|
||||
{
|
||||
};
|
||||
struct ExtInterface2 :
|
||||
Interface<interface_traits::polarization> // doesn't work
|
||||
{
|
||||
};
|
||||
struct ExtModule1 :
|
||||
Module<1> // works
|
||||
{
|
||||
};
|
||||
struct ExtModule2 :
|
||||
Module<module_traits::category> // doesn't work
|
||||
{
|
||||
};
|
||||
%}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue