parent
9b096e6561
commit
088dc6e870
5 changed files with 273 additions and 0 deletions
|
|
@ -663,6 +663,7 @@ namespace std {
|
|||
#ifdef __cplusplus
|
||||
%insert("runtime") %{
|
||||
#ifdef __cplusplus
|
||||
#include <utility>
|
||||
/* SwigValueWrapper is described in swig.swg */
|
||||
template<typename T> class SwigValueWrapper {
|
||||
struct SwigMovePointer {
|
||||
|
|
@ -676,6 +677,9 @@ template<typename T> class SwigValueWrapper {
|
|||
public:
|
||||
SwigValueWrapper() : pointer(0) { }
|
||||
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
|
||||
#if __cplusplus >= 201103L
|
||||
SwigValueWrapper& operator=(T&& t) { SwigMovePointer tmp(new T(std::move(t))); pointer = tmp; return *this; }
|
||||
#endif
|
||||
operator T&() const { return *pointer.ptr; }
|
||||
T *operator&() { return pointer.ptr; }
|
||||
};%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue