diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2009-01-07 21:10:46 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2009-01-07 21:10:46 +0000 |
commit | c577ac1a31a8ae385405088e7faf475229f03ab1 (patch) | |
tree | 6ab936e079efbd534abe7567ff5fbc2d7c3aeeeb | |
parent | f94edcd85559cec9fb1f409394c8a36a457acebc (diff) | |
download | swig-c577ac1a31a8ae385405088e7faf475229f03ab1.tar.gz |
Rename embedded smart pointer in SwigValueWrapper in order to avoid conflicts with the template type
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11038 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | Lib/swig.swg | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/swig.swg b/Lib/swig.swg index 4e0657587..05294a9a5 100644 --- a/Lib/swig.swg +++ b/Lib/swig.swg @@ -634,7 +634,7 @@ namespace std { * arg1 = Vector(1,2,3); // Assignment from a value * * The class offers a strong guarantee of exception safety. - * With regards to the implementation, the private Pointer nested class is + * With regards to the implementation, the private SwigMovePointer nested class is * a simple smart pointer with move semantics, much like std::auto_ptr. * * This wrapping technique was suggested by William Fulton and is henceforth @@ -646,17 +646,17 @@ namespace std { #ifdef __cplusplus /* SwigValueWrapper is described in swig.swg */ template<typename T> class SwigValueWrapper { - struct Pointer { + struct SwigMovePointer { T *ptr; - Pointer(T *p) : ptr(p) { } - ~Pointer() { delete ptr; } - Pointer& operator=(Pointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } } pointer; SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); SwigValueWrapper(const SwigValueWrapper<T>& rhs); public: SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { Pointer tmp(new T(t)); pointer = tmp; return *this; } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } operator T&() const { return *pointer.ptr; } T *operator&() { return pointer.ptr; } };%} |