swig/Lib/d
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
..
boost_shared_ptr.i Add director shared_ptr typemaps for D 2017-10-17 22:47:16 +01:00
carrays.i Initialise all newly created arrays in arrays.i library. 2015-07-30 20:41:15 +01:00
cpointer.i Remove redundant NULL checks before free()/delete (#2184) 2022-01-29 22:03:48 +13:00
d.swg Added support for the D programming languge. 2010-11-18 00:24:02 +00:00
dclassgen.swg Add the parameters typemap attribute to D and Java destructor wrapper typemaps 2019-04-08 19:20:50 +01:00
ddirectives.swg Add %proxycode directive for adding code into proxy classes for C#, D and Java 2017-01-13 20:43:50 +00:00
denums.swg Add c++11 strongly typed enum support for D 2014-11-28 08:13:27 +00:00
dexception.swg [D] Replaced the term "wrap D module" with "intermediary D module" (including names derived from it). 2010-11-28 23:12:03 +00:00
dhead.swg Avoid -Wempty-body warnings from SWIG_contract_assert 2022-02-11 18:39:08 +13:00
director.swg Add raise methods for throwing c++ exceptions in C#, Java, D 2017-05-13 17:01:15 +01:00
dkw.swg Renames performed by %namewarn with rename= are printed in warning message 2022-02-06 13:51:37 -05:00
dmemberfunctionpointers.swg Fix wrapping of references/pointers and qualifiers to member pointers 2017-03-16 21:04:38 +00:00
doperators.swg Fix typos 2021-11-17 07:07:02 +02:00
dprimitives.swg Misc. typos 2018-05-17 10:04:23 -04:00
dstrings.swg [D] Replaced the term "wrap D module" with "intermediary D module" (including names derived from it). 2010-11-28 23:12:03 +00:00
dswigtype.swg Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
dvoid.swg [D] Replaced the term "wrap D module" with "intermediary D module" (including names derived from it). 2010-11-28 23:12:03 +00:00
std_common.i Added support for the D programming languge. 2010-11-18 00:24:02 +00:00
std_deque.i Added support for the D programming languge. 2010-11-18 00:24:02 +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_shared_ptr.i Added support for the D programming languge. 2010-11-18 00:24:02 +00:00
std_string.i std::string typemap modifications so they can be used with %apply for other string classes 2012-05-26 06:33:49 +00:00
std_vector.i Improve backwards compatibility in D std::vector wrappers 2019-04-19 00:22:53 +01:00
stl.i Create a consistent stl.i library file 2019-02-12 18:46:05 +00:00
typemaps.i [D] Use stdc.config.c_long/c_ulong to represent C long types. 2011-12-03 19:48:01 +00:00
wrapperloader.swg D: Replace deprecated imports (package std.c). Fixes #1593 2020-05-30 16:28:48 +01:00