Add unignore for rvalue ref-qualifiers

Use std::move on this pointer as the default approach to supporting
rvalue ref-qualifiers if a user really wants to wrap.

std::move requires <memory> headers so add swigfragments.swg for all
languages to use common fragments. Just header file fragments for now.
This commit is contained in:
William S Fulton 2017-08-25 19:08:09 +01:00
commit 8a40327aa8
10 changed files with 149 additions and 74 deletions

View file

@ -1024,6 +1024,15 @@ int Swig_MethodToFunction(Node *n, const_String_or_char_ptr nspace, String *clas
}
}
if (!self && SwigType_isrvalue_reference(Getattr(n, "refqualifier"))) {
String *memory_header = NewString("<memory>");
Setfile(memory_header, Getfile(n));
Setline(memory_header, Getline(n));
Swig_fragment_emit(memory_header);
self = NewString("std::move(*this).");
Delete(memory_header);
}
call = Swig_cmethod_call(explicitcall_name ? explicitcall_name : name, p, self, explicit_qualifier, director_type);
cres = Swig_cresult(Getattr(n, "type"), Swig_cresult_name(), call);