logo       

Directors and typemap(in) const TYPE&: msg#00147

programming.swig

Subject: Directors and typemap(in) const TYPE&

Hi Mark:

Yesterday I started to use the directors, and it seems the old
'const TYPE&' is not covered, ie, there is only

%typemap(directorin,parse="d") double "";

and this one is missing

%typemap(directorin,parse="d") const double& "";


the same for all the basic types 'int, float, short, ....',
although the case for python/std_complex.i is right.

I know that most people will not declare a function like

double eval(const double& x);

but rather

double eval(double x);

however, with general template forms

template <class T>
T eval (const T& x);

you easily end with situation when you are using const references
even for short types.

I added the missing const TYPES& declaration in python, but given
that the same changes need to be done for the other modules,
I'll rather let you to chose an uniform style for all of them.


Marcelo


_______________________________________________
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