swig/Lib
William S Fulton bf36bf7d8a Movable and move-only types supported in "out" typemaps.
Enhance SWIGTYPE "out" typemaps to use std::move when copying
objects, thereby making use of move semantics when wrapping a function returning
by value if the returned type supports move semantics.

Wrapping functions that return move only types 'by value' now work out the box
without having to provide custom typemaps.

The implementation removed all casts in the "out" typemaps to allow the compiler to
appropriately choose calling a move constructor, where possible, otherwise a copy
constructor. The implementation alsoand required modifying SwigValueWrapper to
change a cast operator from:

  SwigValueWrapper::operator T&() const;

to

  #if __cplusplus >=201103L
    SwigValueWrapper::operator T&&() const;
  #else
    SwigValueWrapper::operator T&() const;
  #endif

This is not backwards compatible for C++11 and later when using the valuewrapper feature
if a cast is explicitly being made in user supplied "out" typemaps. Suggested change
in custom "out" typemaps for C++11 and later code:

1. Try remove the cast altogether to let the compiler use an appropriate implicit cast.
2. Change the cast, for example, from static_cast<X &> to static_cast<X &&>, using the
   __cplusplus macro if all versions of C++ need to be supported.

Issue #999
Closes #1044

More about the commit:
Added some missing "varout" typemaps for Ocaml which was falling back to
use "out" typemaps as they were missing.

Ruby std::set fix for SwigValueWrapper C++11 changes.
2022-06-30 17:26:48 +01:00
..
cffi Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
csharp Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
d Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
go [Go] Make -intgosize optional 2022-03-16 18:30:05 +13:00
guile Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
java Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
javascript Correct warning message for wchar_t * typemaps 2022-05-06 18:44:02 +01:00
lua Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
mzscheme Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
ocaml Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
octave Better Octave typecheck for argc argv typemaps 2022-05-23 08:51:06 +01:00
perl5 argcargv.i cosmetic updates 2022-05-15 18:32:53 +01:00
php Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
python Suppress -Wregister gcc warnings in Python.h 2022-05-27 20:01:57 +01:00
r Renames performed by %namewarn with rename= are printed in warning message 2022-02-06 13:51:37 -05:00
ruby Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
scilab [scilab] Fix to work on Windows 2022-03-15 15:06:17 +13:00
std Add missing hasher and key_type typedefs to C++11 STL containers 2019-03-12 21:59:03 +00:00
tcl argcargv.i cosmetic updates 2022-05-15 18:32:53 +01:00
typemaps Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
xml delete the perl5 typemaps, ignored here 2006-01-05 19:34:51 +00:00
allkw.swg Disable Chicken target language 2019-02-05 18:42:12 +00:00
attribute.i Fix %arg in Lib/attribute.i 2013-05-25 00:37:57 +01:00
carrays.i Fix missing include in SWIG typemap 2019-01-06 08:31:11 -05:00
cdata.i Merge pull request #1398 from swig-fortran/missing-includes 2022-02-01 14:05:17 +13:00
cmalloc.i merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
constraints.i merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
cpointer.i Fix function prototypes of generated pointer functions 2022-02-03 17:25:44 +13:00
cstring.i merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
cwstring.i merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
director_common.swg Create director_common.swg for language-indep code 2015-03-12 19:51:11 +13:00
exception.i [php] Fix two incorrect PHP 8 conditionals 2021-12-08 13:10:38 +13:00
intrusive_ptr.i Fix bug with macro invocation with empty first arg 2017-10-08 09:02:28 +13:00
inttypes.i Remove duplicate declarations of strtoimax and strtoumax in inttypes.i 2014-04-08 23:47:22 +01:00
linkruntime.c fix macro issue reported by Vladimir Menshakov 2006-04-10 19:00:44 +00:00
math.i Conditionalise math.i for PHP 2021-03-17 09:43:15 +13:00
pointer.i Update link to point to 3.0 docs 2015-01-08 11:16:48 +13:00
runtime.swg fix VC++ warning 2005-09-29 13:17:05 +00:00
shared_ptr.i Fix bug with macro invocation with empty first arg 2017-10-08 09:02:28 +13:00
std_except.i [OCaml] Some exception improvements 2019-02-07 16:25:10 -07:00
stdint.i merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
stl.i merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
swig.swg Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
swigarch.i Typo fix in error messages from swigarch.i 2015-02-04 23:07:18 +00:00
swigerrors.swg Remove trailing spaces in the generated code. 2013-09-13 10:02:39 +02:00
swigfragments.swg Merge pull request #1398 from swig-fortran/missing-includes 2022-02-01 14:05:17 +13:00
swiginit.swg Lib/javascript/v8: use context-aware initialization. 2021-03-02 15:31:28 +01:00
swiglabels.swg swiglabels.swg: added check if __GNUC__ is defined 2016-02-13 13:49:07 +01:00
swigrun.i merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
swigrun.swg Fix previous commit 2022-03-20 19:44:23 +13:00
swigwarnings.swg Add support for wchar_t * and std::wstring Unicode strings on Linux 2022-05-02 21:08:19 +01:00
wchar.i merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
windows.i Add missing VOID definition to windows.i 2019-01-07 18:46:14 +00:00