Add rvalue reference typemaps
This commit is contained in:
parent
d3769a1fd4
commit
ac74c90fb0
6 changed files with 127 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue