%module template_template_parameters %inline %{ /* part 1 */ namespace pfc { template class t_alloc> class array_t {}; template class alloc_fast { public: typedef t_item alloc_type; }; } template class list_impl_t {}; template class t_alloc = pfc::alloc_fast > class list_tt : public list_impl_t > { public: t_item item; typename t_alloc::alloc_type allotype; // SWIG can handle this now void xx() { typename t_alloc::alloc_type atype; // this type is the same as t_item type atype = true; } }; void TestInstantiations() { pfc::array_t myArrayInt; list_impl_t > myListImplInt; (void) myArrayInt; (void) myListImplInt; } /* part 2 */ template struct Container1 { T x; }; template struct Container2 { U x; }; template class TemplateTemplateT> struct TestStruct { TemplateTemplateT x; }; TestStruct TestStructContainer1Method(TestStruct ts1) { ts1.x.x += 10; return ts1; } %} /* part 1 */ %template(ListImplFastBool) list_impl_t >; %template(ListFastBool) list_tt; %template(ListImplFastDouble) list_impl_t >; %template(ListDefaultDouble) list_tt; %template(BoolAllocFast) pfc::alloc_fast; %template(DoubleAllocFast) pfc::alloc_fast; /* part 2 */ %template(IntContainer1) Container1; %template(FloatContainer2) Container2; %template(IntTestStruct) TestStruct; %template(FloatTestStruct) TestStruct;