swig/Lib/ocaml
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
..
carray.i [OCaml] Fix compilation errors with OCaml 4.09.0 2019-12-29 22:41:43 -07:00
class.swg [OCaml] Fix member var getters and setters 2019-01-06 09:40:25 -07:00
cstring.i [OCaml] Define CAML_NAME_SPACE before including caml/ headers 2019-01-28 06:56:18 -07:00
director.swg [OCaml] Define CAML_NAME_SPACE before including caml/ headers 2019-01-28 06:56:18 -07:00
extra-install.list [OCaml] Remove the last remnants of libswigocaml 2019-01-18 23:48:46 -07:00
ocaml.i [OCaml] Rename typemaps.i to ocaml.swg 2019-02-18 22:42:20 -07:00
ocaml.swg Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
ocamlkw.swg Update a dead link. 2018-12-30 02:51:58 -07:00
ocamlrun.swg [Ocaml] Fix to work with CAML_SAFE_STRING 2022-02-01 13:29:53 +13:00
ocamlrundec.swg Avoid -Wempty-body warnings from SWIG_contract_assert 2022-02-11 18:39:08 +13:00
preamble.swg Some delayed maintenance. 2004-10-17 07:56:17 +00:00
std_common.i [OCaml] Fix the wrapmacro test 2019-02-17 01:41:59 -07:00
std_complex.i Fixes to comply with with ISO/IEC 14882:1998(E) 17.4.3.1.2 (symbol names) 2003-09-23 21:16:38 +00:00
std_deque.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
std_except.i [OCaml] Some exception improvements 2019-02-07 16:25:10 -07:00
std_list.i Add STL container copy constructors where missing 2019-02-14 18:53:05 +00: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 Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01: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
swig.ml [OCaml] Fix a bug in the ctors of director classes 2019-02-05 13:35:43 -07:00
swig.mli [OCaml] Fix a bug in the ctors of director classes 2019-02-05 13:35:43 -07:00
swigp4.ml Make Lib/ocaml/swigp4.ml a non-generated file. 2014-02-19 22:35:45 +13:00
typecheck.i [OCaml] Move INPUT, OUTPUT, and INOUT typemaps to typemaps.i 2019-02-18 23:02:20 -07:00
typemaps.i [OCaml] Move INPUT, OUTPUT, and INOUT typemaps to typemaps.i 2019-02-18 23:02:20 -07:00
typeregister.swg - Improve the runtime type sytesm 2005-02-01 00:08:24 +00:00