%module template_typedef_class_template #ifdef SWIGOCAML %warnfilter(SWIGWARN_PARSE_KEYWORD) val; #endif %inline %{ namespace Standard { template struct Pair { T first; U second; }; } %} // previously these typemaps were erroneously being used as iterator was not correctly scoped in Multimap %typemap(out) Standard::Pair "_this_will_not_compile_iterator_" %typemap(out) Standard::Pair "_this_will_not_compile_const_iterator_" %{ namespace Standard { template class Multimap { public: typedef Key key_type; typedef T mapped_type; class iterator {}; class const_iterator {}; // test usage of a typedef of a nested class in a template Standard::Pair equal_range_1(const key_type& kt1) { return Standard::Pair(); } Standard::Pair equal_range_2(const key_type& kt2) const { return Standard::Pair(); } }; } %} namespace Standard { template class Multimap { public: typedef Key key_type; typedef T mapped_type; class iterator; class const_iterator; // test usage of a typedef of a nested class in a template Standard::Pair equal_range_1(const key_type& kt1) {} Standard::Pair equal_range_2(const key_type& kt2) const {} }; } %inline %{ struct A { int val; A(int v = 0): val(v) {} }; %} %template(PairA) Standard::Pair; %template(MultimapA) Standard::Multimap;