Skip to content
Snippets Groups Projects
Commit f6c21cd8 authored by ilor's avatar ilor
Browse files

add .get(), __bool__ and __nonzero__ to shared_ptr wrapper to allow testing if...

add .get(), __bool__ and __nonzero__ to shared_ptr wrapper to allow testing if the shared_ptr is valid
parent 1084636d
Branches
No related merge requests found
......@@ -14,6 +14,14 @@ namespace boost {
shared_ptr();
shared_ptr(T * p);
T* operator->();
T* get();
%pythoncode %{
def __bool__(self):
return self.get() is not None
__nonzero__=__bool__
%}
private:
T * px;
int pn;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment