swig/Lib/guile
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
..
common.scm SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
cplusplus.i Drop guilegh interface 2013-04-28 22:06:24 +02:00
extra-install.list Install common.scm. 2003-10-05 11:42:36 +00:00
guile.i SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
guile_scm.swg Fix overloading for non-pointers and NULL - Guile 2018-12-30 09:26:33 +00:00
guile_scm_run.swg Avoid -Wempty-body warnings from SWIG_contract_assert 2022-02-11 18:39:08 +13:00
guilemain.i guile - drop GDB_INTERFACE related stuff 2018-04-20 08:36:49 +02:00
interpreter.i SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
list-vector.i Remove redundant NULL checks before free()/delete (#2184) 2022-01-29 22:03:48 +13:00
Makefile Whitespace cleanup of all Makefiles* 2014-05-02 20:06:11 +02:00
pointer-in-out.i SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
ports.i Simplify and improve Guile FILE * in typemap 2013-05-16 19:21:59 +01:00
std_common.i Remove redundant NULL checks before free()/delete (#2184) 2022-01-29 22:03:48 +13:00
std_deque.i Each target language now has its own std_deque.i like the other STL wrappers. 2006-01-08 20:08:44 +00:00
std_except.i Fix missed files 2016-09-17 19:01:42 +02:00
std_map.i Add STL container copy constructors where missing 2019-02-14 18:53:05 +00:00
std_pair.i Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
std_string.i Remove redundant NULL checks before free()/delete (#2184) 2022-01-29 22:03:48 +13:00
std_vector.i Add STL container copy constructors where missing 2019-02-14 18:53:05 +00:00
stl.i Create a consistent stl.i library file 2019-02-12 18:46:05 +00:00
swigrun.i Move the magic with the (Swig swigrun) module here. 2004-07-24 15:21:17 +00:00
typemaps.i Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00