%module naturalvar_more #if defined(SWIGMATLAB) %rename(glob1) glob; #endif // The instantiation of a template using an enum in the template parameter was not picking up %naturalvar. // These typemaps will be used if %naturalvar is not working %typemap(out) T *te, T *const_te "_should_not_use_this_out_typemap_" %typemap(varout) T *te, T *const_te "_should_not_use_this_varout_typemap_" %typemap(out) Hidden *hidden "_should_not_use_this_out_typemap_" %typemap(varout) Hidden *hidden "_should_not_use_this_varout_typemap_" %naturalvar T; %naturalvar Hidden; %inline %{ template struct T {}; struct K {}; struct Hidden; namespace Ace { int glob; } %} %{ struct Hidden {}; namespace Ace { template struct NoIdea {}; } %} %inline %{ namespace Space { enum E { E1, E2, E3 }; } %} %template(TE) T; %include %include %template(VectorString) std::vector; %inline { using namespace Space; struct S { T te; const T const_te; const std::vector::value_type const_string_member; // check this resolves to std::string which has a naturalvar std::vector::value_type string_member; // check this resolves to std::string which has a naturalvar Hidden hidden; Ace::NoIdea noidea; S() : const_te(), const_string_member("initial string value") {} }; }