Add PHP support for std::unique_ptr and std::auto_ptr

Equivalent to Python/Ruby implementations.
This commit is contained in:
William S Fulton 2022-08-06 18:34:26 +01:00
commit fa9c7a7197
7 changed files with 265 additions and 5 deletions

View file

@ -1,6 +1,6 @@
%module cpp11_std_unique_ptr
#if defined(SWIGCSHARP) || defined(SWIGJAVA) || defined(SWIGPYTHON) || defined(SWIGRUBY) || defined(SWIGPERL) || defined(SWIGTCL) || defined(SWIGOCTAVE) || defined(SWIGJAVASCRIPT) || defined(SWIGD)
#if defined(SWIGCSHARP) || defined(SWIGJAVA) || defined(SWIGPYTHON) || defined(SWIGRUBY) || defined(SWIGPERL) || defined(SWIGTCL) || defined(SWIGOCTAVE) || defined(SWIGJAVASCRIPT) || defined(SWIGD) || defined(SWIGPHP)
%include "std_string.i"
%include "std_unique_ptr.i"
@ -68,6 +68,10 @@ std::string takeKlassUniquePtr(std::unique_ptr<Klass> k) {
return s;
}
Klass *make_null() {
return nullptr;
}
bool is_nullptr(Klass *p) {
return p == nullptr;
}