#include namespace a { template class A { private: void operator=(const A&); }; } namespace b { template class A {}; template class B {}; class C { public: std::vector v; a::A a; a::A a2; A a3; A a4; B b; B b2; b::B b3; b::B b4; B > ba; B > ba2; b::B > ba3; b::B > ba4; B > ba5; B > ba6; // These don't work. Because the type is qualified, convert_swig assumes // it's fully qualified and puts the %template directive in the global // namespace. However, there is no A in the global namespace, so the wrapper // code fails to compile. Bonus points if you can fix this without breaking // something else. //b::B > ba7; //b::B > ba8; }; // This class is the same as the previous. Seems weird, but it reveals scoping // errors under SWIG 2. The replication is not necessary in SWIG 4, which has // better error detection. class D { public: std::vector v; a::A a; a::A a2; A a3; A a4; B b; B b2; b::B b3; b::B b4; B > ba; B > ba2; b::B > ba3; b::B > ba4; B > ba5; B > ba6; //b::B > ba7; //b::B > ba8; }; } class E { public: std::vector v; a::A a; a::A a2; b::B b3; b::B b4; b::B > ba3; b::B > ba4; }; namespace a { class B { public: std::vector v; a::A a; a::A a2; A a3; A a4; b::B b3; b::B b4; b::B > ba3; b::B > ba4; //b::B > ba7; //b::B > ba8; }; }