swig/Examples/test-suite/go
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
..
abstract_access_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
abstract_typedef2_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
abstract_typedef_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
abstract_virtual_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
argout_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
array_member_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
arrays_global_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
char_binary_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
class_case_runme.go Add CHANGES entry and regression test for #676 2022-01-29 22:35:29 +13:00
class_ignore_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
class_scope_weird_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
compactdefaultargs_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
constover_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
constructor_copy_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
contract_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
cpp11_std_array_runme.go Support std::array in Golang (#2045) 2022-01-04 12:12:56 +13:00
cpp11_strongly_typed_enumerations_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
cpp_enum_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
cpp_namespace_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
cpp_static_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
default_args_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
default_constructor_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_alternating_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_basic_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_classic_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_default_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_detect_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_enum_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_exception_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_extend_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_finalizer_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_frob_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_nested_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_profile_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_protected_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_string_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
director_unroll_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
disown_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
dynamic_cast_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
empty_c_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
empty_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
enum_template_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
enums_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
exception_order_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
extend_placement_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
extend_template_ns_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
extend_template_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
extend_variable_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
extern_c_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
friends_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
fvirtual_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
global_ns_arg_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
go_director_inout_runme.go [Go] Add a test for godirectorin with const char ** 2022-04-18 19:55:34 -05:00
go_inout_runme.go [Go] Don't convert arrays to pointers if there is a "gotype" typemap entry. 2022-03-15 12:18:47 -07:00
go_subdir_import_runme.go Fix Go tests to run in module mode 2019-04-24 21:43:38 -07:00
grouping_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
import_nomodule_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
imports_runme.go Fix Go tests to run in module mode 2019-04-24 21:43:38 -07:00
inctest_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
inherit_member_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
inherit_missing_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
input_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
keyword_rename_c_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
keyword_rename_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_attribute_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_carrays_cpp_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_carrays_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_cdata_cpp_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_cdata_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_cmalloc_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_cpointer_cpp_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_cpointer_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_std_map_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
li_std_vector_ptr_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
Makefile.in Consistent cpp11 testing in test-suite 2022-03-27 19:34:20 +01:00
member_pointer_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
memberin_extend_c_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
minherit_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
mod_runme.go Fix Go tests to run in module mode 2019-04-24 21:43:38 -07:00
multi_import_runme.go Fix Go tests to run in module mode 2019-04-24 21:43:38 -07:00
namespace_class_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
namespace_typemap_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
namespace_virtual_method_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
naturalvar_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
nested_workaround_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_complicated_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_copy_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_extend2_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_extend_c_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_extend_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_polymorphic_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_rename_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_simple_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_subtype_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_template_fast_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
overload_template_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
preproc_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
primitive_ref_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
profiletest_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
refcount_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
reference_global_vars_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
rename_scope_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
rename_simple_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
rename_strip_encoder_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
ret_by_value_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
return_const_value_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
smart_pointer_extend_runme.go [Go] Implement %extend base methods in child classes. 2022-03-18 18:34:28 -07:00
smart_pointer_member_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
smart_pointer_multi_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
smart_pointer_multi_typedef_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
smart_pointer_overload_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
smart_pointer_rename_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
smart_pointer_simple_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
smart_pointer_templatevariables_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
smart_pointer_typedef_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
sneaky1_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
special_variable_macros_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
static_const_member_2_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
struct_initialization_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
struct_rename_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
struct_value_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_default_arg_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_extend1_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_extend2_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_inherit_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_ns4_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_ns_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_opaque_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_ref_type_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_rename_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_static_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_tbase_template_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_type_namespace_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_typedef_cplx3_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
template_typedef_cplx4_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
threads_exception_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
typedef_class_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
typedef_funcptr_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
typedef_inherit_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
typedef_scope_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
typemap_namespace_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
typemap_ns_using_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
typemap_out_optimal_runme.go Movable and move-only types supported in "out" typemaps. 2022-06-30 17:26:48 +01:00
typename_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
unions_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
using1_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
using2_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
using_composition_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
using_extend_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
using_inherit_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
using_private_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
using_protected_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
varargs_overload_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
varargs_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
virtual_derivation_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
virtual_poly_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
voidtest_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00
wrapmacro_runme.go Fix all Go tests to build with "go build" 2019-08-08 14:30:50 -07:00