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
23
Examples/test-suite/schemerunme/cpp11_move_typemaps.scm
Normal file
23
Examples/test-suite/schemerunme/cpp11_move_typemaps.scm
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
(Counter-reset-counts)
|
||||
(define mo (new-MoveOnly 111))
|
||||
(Counter-check-counts 1 0 0 0 0 0)
|
||||
(MoveOnly-take mo)
|
||||
(Counter-check-counts 1 0 0 1 0 2)
|
||||
(delete-MoveOnly mo)
|
||||
(Counter-check-counts 1 0 0 1 0 2)
|
||||
|
||||
(Counter-reset-counts)
|
||||
(define mo (new-MovableCopyable 111))
|
||||
(Counter-check-counts 1 0 0 0 0 0)
|
||||
(MovableCopyable-take mo)
|
||||
(Counter-check-counts 1 0 0 1 0 2)
|
||||
(delete-MovableCopyable mo)
|
||||
(Counter-check-counts 1 0 0 1 0 2)
|
||||
|
||||
(define mo (new-MoveOnly 222))
|
||||
(MoveOnly-take mo)
|
||||
(expect-throw 'misc-error
|
||||
(MoveOnly-take mo))
|
||||
; TODO: check the exception message
|
||||
|
||||
(exit 0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue