Add rvalue reference typemaps

This commit is contained in:
William S Fulton 2013-01-24 20:23:54 +00:00
commit ac74c90fb0
6 changed files with 127 additions and 6 deletions

View file

@ -3,9 +3,20 @@
* ------------------------------------------------------------ */
%apply int { enum SWIGTYPE };
%apply const int& { const enum SWIGTYPE& };
%apply const int& { const enum SWIGTYPE & };
%apply const int& { const enum SWIGTYPE && };
%typemap(in,fragment=SWIG_AsVal_frag(int),noblock=1) const enum SWIGTYPE& (int val, int ecode, $basetype temp) {
%typemap(in,fragment=SWIG_AsVal_frag(int),noblock=1) const enum SWIGTYPE & (int val, int ecode, $basetype temp) {
ecode = SWIG_AsVal(int)($input, &val);
if (!SWIG_IsOK(ecode)) {
%argument_fail(ecode, "$type", $symname, $argnum);
} else {
temp = %static_cast(val,$basetype);
$1 = &temp;
}
}
%typemap(in,fragment=SWIG_AsVal_frag(int),noblock=1) const enum SWIGTYPE && (int val, int ecode, $basetype temp) {
ecode = SWIG_AsVal(int)($input, &val);
if (!SWIG_IsOK(ecode)) {
%argument_fail(ecode, "$type", $symname, $argnum);