swig/Lib/lua
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
..
_std_common.i Fix comment typos in Lua typemaps 2012-05-28 18:32:24 +00:00
argcargv.i Document argc argv library 2022-05-15 19:12:39 +01:00
carrays.i Fix comment typos in Lua typemaps 2012-05-28 18:32:24 +00:00
factory.i Add missing Lua factory.i for patch #3219676 2012-04-24 18:37:53 +00:00
lua.swg Fix typos in docs and comments 2022-02-27 18:15:46 +13:00
lua_fnptr.i Fix typos in docs and comments 2022-02-27 18:15:46 +13:00
luakw.swg Renames performed by %namewarn with rename= are printed in warning message 2022-02-06 13:51:37 -05:00
luarun.swg Fix typos in docs and comments 2022-02-27 18:15:46 +13:00
luaruntime.swg Fix overloading for non-pointers and NULL - Lua 2018-12-30 10:54:53 +00:00
luatypemaps.swg Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
std_common.i Added more STL (more exceptions, map, size_t), fixed test case: conversion_ns_template. 2006-12-26 10:15:35 +00: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 Add <typeinfo> header for std::bad_cast 2016-09-17 13:24:32 +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 Add missing parameter names in STL container wrappers 2019-02-13 22:45:47 +00:00
std_vector.i Add STL container copy constructors where missing 2019-02-14 18:53:05 +00:00
stl.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
typemaps.i Fix typos in docs and comments 2022-02-27 18:15:46 +13:00
wchar.i Bug fix (typo - "wchar" instead of "wchar_t") 2013-12-12 16:53:23 +13:00