Provide SWIGTYPE MOVE typemaps in swigmove.i
For implementing full move semantics when passing parameters by value. Based on SWIGTYPE && and std::unique_ptr typemaps which implement move semantics. Added for all languages, but untested for: Go, Ocaml, R, Scilab (and unlikely to be fully functional for same reasons as for std::unique_ptr support). Issue #999
This commit is contained in:
parent
de65875955
commit
dad7c93ca0
41 changed files with 909 additions and 19 deletions
11
Lib/ocaml/swigmove.i
Normal file
11
Lib/ocaml/swigmove.i
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* swigmove.i
|
||||
*
|
||||
* Input typemaps library for implementing full move semantics when passing
|
||||
* parameters by value.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%typemap(in, noblock=1) SWIGTYPE MOVE (void *argp = 0) {
|
||||
argp1 = ($&1_ltype) caml_ptr_val($input,$&1_descriptor);
|
||||
SwigValueWrapper< $1_ltype >::reset($1, ($&1_type)argp);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue