%module template_class_reuse_name // One parameter templates %inline %{ namespace Space { template struct Bool1 { void tt(){}; void ff(){}; }; template struct Bool2 { void tt(){}; void ff(){}; }; template struct Bool3 {}; template <> struct Bool3 { void tt(){}; }; template <> struct Bool3 { void ff(){}; }; template struct Bool4 { void tt(){}; }; template <> struct Bool4 { void ff(){}; }; } %} // Instantiated names are the same as C++ template name %template(Bool1) Space::Bool1; %template(Bool2) Space::Bool2; %template(Bool3) Space::Bool3; %template(Bool4) Space::Bool4; // Instantiated names are not the same as C++ template name %template(Bool1False) Space::Bool1; %template(Bool2False) Space::Bool2; %template(Bool3False) Space::Bool3; %template(Bool4False) Space::Bool4; // Forward declared templates %inline %{ namespace Space { template struct BoolForward1; template struct BoolForward2; template struct BoolForward3; template struct BoolForward4; template struct BoolForward1 { void tt(){}; void ff(){}; }; template struct BoolForward2 { void tt(){}; void ff(){}; }; template struct BoolForward3 {}; template <> struct BoolForward3 { void tt(){}; }; template <> struct BoolForward3 { void ff(){}; }; template struct BoolForward4 { void tt(){}; }; template <> struct BoolForward4 { void ff(){}; }; } %} // Instantiated names are the same as C++ template name %template(BoolForward1) Space::BoolForward1; %template(BoolForward2) Space::BoolForward2; %template(BoolForward3) Space::BoolForward3; %template(BoolForward4) Space::BoolForward4; // Instantiated names are not the same as C++ template name %template(BoolForward1False) Space::BoolForward1; %template(BoolForward2False) Space::BoolForward2; %template(BoolForward3False) Space::BoolForward3; %template(BoolForward4False) Space::BoolForward4; // Two parameter templates %inline %{ namespace Space { template struct IntBool1 { void tt(){}; void ff(){}; }; template struct IntBool2 { void tt(){}; void ff(){}; }; template struct IntBool3 {}; template struct IntBool3 { void tt(){}; }; template struct IntBool3 { void ff(){}; }; template struct IntBool4 { void tt(){}; }; template struct IntBool4 { void ff(){}; }; } %} // Instantiated names are the same as C++ template name %template(IntBool1) Space::IntBool1<0, true>; %template(IntBool2) Space::IntBool2<0, true>; %template(IntBool3) Space::IntBool3<0, true>; %template(IntBool4) Space::IntBool4<0, true>; // Instantiated names are not the same as C++ template name %template(IntBool1False) Space::IntBool1<0, false>; %template(IntBool2False) Space::IntBool2<0, false>; %template(IntBool3False) Space::IntBool3<0, false>; %template(IntBool4False) Space::IntBool4<0, false>; %{ namespace Space { template struct Duplicate1 { void ff(){}; }; } %} %warnfilter(SWIGWARN_PARSE_REDEFINED) Space::Duplicate1; namespace Space { template struct Duplicate1 { void ff(){}; }; template struct Duplicate1 { void ff(){}; }; } %warnfilter(SWIGWARN_PARSE_REDEFINED) Space::Duplicate2; %inline %{ namespace Space { template struct Duplicate2 { void n(){}; }; } %} %template(Duplicate2_0) Space::Duplicate2<0>; %template(Duplicate2_0) Space::Duplicate2<0>; %warnfilter(SWIGWARN_PARSE_REDEFINED) Space::Duplicate3; %inline %{ namespace Space { template struct Duplicate3 { void n(){}; }; } %} %template(Duplicate3) Space::Duplicate3<0>; %template(Duplicate3) Space::Duplicate3<0>; %{ namespace Space { template struct Duplicate4 { void ff(){}; }; } %} %warnfilter(SWIGWARN_PARSE_REDEFINED) Space::Duplicate4; namespace Space { template struct Duplicate4 { void ff(){}; }; template struct Duplicate4 { void ff(){}; }; } %template(Duplicate4) Space::Duplicate4<0>; %template(Duplicate4) Space::Duplicate4<0>;