1 %module extend_template_ns 2 %inline %{ 3 namespace oss 4 { 5 enum Test {One, Two}; 6 } 7 %} 8 9 namespace oss { 10 %extend Foo<One> { //************ this doesn't work test1(int x)11 int test1(int x) { return x; } 12 }; 13 } 14 15 %extend oss::Foo<oss::One> { //******** this works test2(int x)16int test2(int x) { return x; } 17 }; 18 19 %inline %{ 20 namespace oss 21 { 22 template <Test> 23 struct Foo { 24 }; 25 } 26 %} 27 28 namespace oss 29 { 30 %template(Foo_One) Foo<One>; 31 } 32 33