logo       

RE: SWIG: std::string returned as reference - solution: msg#00132

programming.swig

Subject: RE: SWIG: std::string returned as reference - solution

Nair, Sanjay S writes:
> > This is different than most OUTPUT typemaps which do not modify their
> > arguments. Use std::string &REFERENCE if you're going to do that (to
> > be consistent with other typemaps that behave in the same way).
>
> What happens if you have multiple out params?
>
>

Well, that's an entirely different problem.
> >
> > %typemap(in) std::string*, std::string& ($basetype string_temp) {
> > if (!SvPOK($input)) {
> > croak("Argument $argnum is not a string");
> > }
> > $1 = &string_temp;
> > argvi++;
> > }
> >

I just noticed this, but why are you incrementing argvi++ in an "in"
typemap? That's related to output, not input.

-- Dave
_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise