Add PHP support for std::unique_ptr and std::auto_ptr
Equivalent to Python/Ruby implementations.
This commit is contained in:
parent
d4b1152d4b
commit
fa9c7a7197
7 changed files with 265 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue