Why are non-const typemaps matching const parameters?

Lindley French <[email protected]> Sun, 17 Oct 2021 10:02:26 -0700
Newsgroups gmane.comp.programming.swig
Message-ID <CALwtg05XNP2nybnd25UPoAvKUGE_b2zXN_vvB+mP487pyU9fKA@mail.gmail.com>
I'm trying to make it so that argout typemaps are only applied to non-const
parameters. On a function F(const T*) I want only the in typemap for T; on
a function G(T*) I want both the in and argout typemaps for T.

I'm doing this:

%typemap(in) TYPE {...}
%typemap(argout) OUTPUT_TYPE {...}

%apply TYPE { T&, T*, const T&, const T* }
%apply OUTPUT_TYPE { T&, T* }

However, I can see in the generated code that the argout typemap is being
used for the const T* case. What's going on and how can I fix it?

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user