swig/Lib/java
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
..
arrays_java.i Lib/java/arrays_java.i: use actual C/C++ type in JAVA_ARRAYS_TYPEMAPS. 2021-03-19 16:29:48 +01:00
boost_intrusive_ptr.i Fix overloading of shared_ptr method overloading 2017-09-23 15:19:34 +01:00
boost_shared_ptr.i Add director shared_ptr typemaps for Java 2017-10-16 18:21:31 +01:00
director.swg Cosmetic tidyup in SWIG_JAVA_DETACH_ON_THREAD_END code 2022-05-28 10:22:34 +01:00
enums.swg Java enums - remove redundant typemaps 2014-03-28 07:45:23 +00:00
enumsimple.swg The 'directorin' typemap now accepts , etc expansions instead of having to use workarounds - _name, _name etc. 2011-12-21 07:16:44 +00:00
enumtypesafe.swg Java enums - remove redundant typemaps 2014-03-28 07:45:23 +00:00
enumtypeunsafe.swg The 'directorin' typemap now accepts , etc expansions instead of having to use workarounds - _name, _name etc. 2011-12-21 07:16:44 +00:00
java.swg Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
javahead.swg Avoid -Wempty-body warnings from SWIG_contract_assert 2022-02-11 18:39:08 +13:00
javakw.swg Renames performed by %namewarn with rename= are printed in warning message 2022-02-06 13:51:37 -05:00
std_array.i Improve backwards compatibility in C#/Java std::array wrappers 2019-04-19 11:06:24 +01:00
std_auto_ptr.i Fix more "allows to" and other typos 2021-04-21 15:54:46 +12:00
std_common.i const size_t& typemaps added 2006-10-17 21:43:40 +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_list.i Java std::vector improvements for types that do not have a default constructor. 2019-03-01 18:01:14 +00:00
std_map.i Handle review comments 2019-02-22 10:55:20 -06:00
std_pair.i Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
std_set.i Fix std::vector<> Java typemaps for primitive types 2019-07-11 13:10:23 +02:00
std_shared_ptr.i Add std_shared_ptr.i and document shared_ptr library 2010-06-01 19:03:55 +00:00
std_string.i Use more conventional naming for generated Java LocalRefGuard variables 2014-09-27 14:32:03 +01:00
std_unordered_map.i Handle review comments 2019-02-22 10:55:20 -06:00
std_unordered_set.i Correct unordered_set/unordered_multiset template Key parameter name 2019-03-12 20:21:19 +00:00
std_vector.i Java std::vector constructor performance improvement 2019-06-06 19:29:11 +01:00
std_wstring.i Java wstring throws typemap improvements 2022-05-07 08:16:48 +01:00
stl.i Create a consistent stl.i library file 2019-02-12 18:46:05 +00:00
swiginterface.i Fix Java %interface family of macros 2021-04-27 23:37:18 +01:00
typemaps.i Fix crash Java directors 2018-08-12 13:45:43 +01:00
various.i follow-up typos 2018-05-17 10:26:00 -04:00