swig/Lib/php
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
..
argcargv.i argcargv.i cosmetic updates 2022-05-15 18:32:53 +01:00
const.i Improve naming of zend_class_entry structs 2021-12-17 17:14:54 +13:00
director.swg [php] Fix director upcall check 2022-01-22 20:01:00 +13:00
factory.i [php] Generate PHP type declarations 2022-01-20 10:07:44 +13:00
php.swg Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
phpinit.swg Fix segfault in exception class creation 2021-05-04 13:12:15 +12:00
phpinterfaces.i [php] Fix two incorrect PHP 8 conditionals 2021-12-08 13:10:38 +13:00
phpkw.swg Renames performed by %namewarn with rename= are printed in warning message 2022-02-06 13:51:37 -05:00
phppointers.i [php] Generate PHP type declarations 2022-01-20 10:07:44 +13:00
phprun.swg Fix typos 2022-02-10 16:12:24 +13:00
std_common.i php: Trim trailing whitespace from PHP typemaps 2021-03-26 10:19:57 +13:00
std_deque.i WARN_* constants are user visible, so keep existing WARN_PHP4_* for 2008-07-03 00:09:56 +00:00
std_map.i php: Trim trailing whitespace from PHP typemaps 2021-03-26 10:19:57 +13:00
std_pair.i Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
std_string.i [PHP] Fix cleanup code handling issues 2022-02-17 13:52:44 +13:00
std_vector.i php: Trim trailing whitespace from PHP typemaps 2021-03-26 10:19:57 +13:00
stl.i php: Trim trailing whitespace from PHP typemaps 2021-03-26 10:19:57 +13:00
typemaps.i [php] Eliminate sprintf to temp buffer to create ZVAL 2022-06-09 09:06:12 +12:00
utils.i [php] Fix long long handling on 32 bit platforms 2022-01-22 13:09:34 +13:00